What are Accelerated Mobile Pages?
Accelerated Mobile Pages (AMP) is an open-source initiative intended as an open standard for any publisher to have pages load quickly on mobile devices. To reduce page weight and decrease page load time, AMP pages do not allow JavaScript to load on the page except in an iframe.
These pages create a challenge to accurately measure unique visitors and understand user acquisition and retention.
Digital Analytics code depends on the JavaScript file eluminate.js
. Either eluminate.js
must load in an AMP iframe using AMP rules (tracking the iframe rather than the page itself) or the data must be built into an AMP image request matching the image request elements eluminate.js
generates.
Enabling Digital Analytics for Accelerated Mobile Pages (AMP)
You can either create an iframe that contains your Digital Analytics code or create a JSON object to send a raw image request through AMP to ensure user data is accurately measured.
Create an iframe to contain your Digital Analytics code:
- You must use the
amp-iframe
element. - AMP requires the iframe to be 600px or 75% of the first viewport from the top.
- The iframe can only request resources via HTTPS, and they cannot be of the same origin as the container unless they do not specify
allow-same-origin
. - The iframe content must load
eluminate.js
. - Digital Analytics is called by standard tagging.
Create a JSON object to send a raw image request through AMP:
- The image request format must adhere to Digital Analytics specifications
- This example tag request is sent to an Acoustic-managed data collection domain (dcd) provisioned for your account by Digital Analytics Support. Replace the value
dcd.mysite.com
with your assigned Acoustic-managed data collection domain.<img alt="" src="http://dcd.mysite.com/cm?ci=59990000%7CSITEID123& st=1443555185620&vn1=4.1.1&ec=utf-8&vn2=mobile&pi=Page%20ID&ul=http%3A%2F%2F127.0.0.1 %2Fmobileguide%2FTagTester_mobileguide-examples.html&tid=1&cg=Category%20ID &se=Search%20Term&sr=56&rnd=1443560080929&pv_a1=attr1&pv_a2=attr2&pv_a3=attr3 &pv1=extrafield1&pv2=extrafield2&pv3=extrafield3">
- This example tag request is sent to an Acoustic-managed data collection domain (dcd) provisioned for your account by Digital Analytics Support. Replace the value
- Digital Analytics data items are defined in the JSON object and referenced in the image request.
- For Client Managed First-Party data collection, the JSON object must include
cjsid
,cjuid
,cjen
,cjvf
values and the user and session values for these must be managed server-side and instantiated in the JSON object. - For Acoustic Managed First Part data collection, the user and session values are managed by the server.
A Sample JSON object:
<script type="application/json">
{
"requests": {
"pageview": "//data.de.coremetrics.com/cm?ci=${ci}|${siteId}&pi=${pi}&ul=${ul}&pv_a1=${pv_a1}&pv_a2=${pv_a2}&pv_a5=${pv_a5}&cjen=${cjen}&cjuid=${cjuid}&cjsid=${cjsid}&cjvf=${cjvf},
"vars": {
"ci": "999999999",
"siteId": "XXXXXXXXX",
"pi": "XXXXXXXXX | Page title here 123454321",
"ul": "http://www.yoursitehere.com/news/page-title-here-123454321",
"pv_a1": "1",
"pv_a2": "Google AMP",
"pv_a5": “ExploreAttribute5",
"cjen":"1",
"cjuid":"123456789099987654321 ",
"cjsid":"9999999999 ",
"cjvf":“1"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview" }
</script>
Typical scenarios that require the generation of non-eluminate image requests
There is a handful of client device and server-side implementations that require non-eluminate image requests.
Mini-browser or other client device implementations that require non-eluminate image requests:
- Devices that don't support JavaScript VM 1.2 or higher.
- Devices that don't fully support session and/or persistent cookies.
Server-side implementations that require non-eluminate image requests:
- Batch processing of orders or other activity unable to be tracked through online browser activity.
- Tracking marketing or other third-party integration activity not available online.
- Tracking server-side redirects.
Comments
0 comments
Article is closed for comments.