Amphtml: AMP analytics variable pageViewId64 appears not to work

Created on 27 Nov 2019  路  3Comments  路  Source: ampproject/amphtml

What's the issue?

Analytics variable pageViewId64 appears to produce no output.

How do we reproduce the issue?

Attempt to implement analytics vendor extension tracking using the ${pageViewId64} variable. Variable returns empty.

Eg. configuring a GET request as follows:

...
'requests': {
  'basePrefix': 'https://${collectorHost}/i?p=web',
  'pageView': '${basePrefix}&e=pv',
},
'extraUrlParams': {
  'pvId'='${pageViewId64}'
}
...

Results in a request:

https://${collectorHost}/i?p=web&e=pv&pvId=

Keen to understand if this misuse by me, a feature not yet implemented, or a bug as a unique ID per page view aligns nicely with the rest of our platform's tracking strategy.

amp-analytics Bug analytics

All 3 comments

you can use PAGE_VIEW_ID_64 directly, or assign it to a var so that you can do ${pageViewId64}

vars: {
  pageViewId64: "PAGE_VIEW_ID_64",
}

worth considering put it to the default vars:
https://github.com/ampproject/amphtml/blob/60d370b0a845c310eacc46798d1e013a10e1a352/extensions/amp-analytics/0.1/vendors.js#L145-L147

馃う鈥嶁檪I suspected I was missing something obvious - apologies for the noise, thanks for the help!

@colmsnowplow, I don鈥檛 think your assumption was wrong. The docs clearly state this is a valid amp-analytics variable.

I鈥檝e raised a PR to add it to the list of default variables here: #30948

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpettitt picture jpettitt  路  3Comments

sryze picture sryze  路  3Comments

choumx picture choumx  路  3Comments

aghassemi picture aghassemi  路  3Comments

edhollinghurst picture edhollinghurst  路  3Comments