DCR Italy Static Google AMP Cloud API: Difference between revisions
From Engineering Client Portal
| (12 intermediate revisions by the same user not shown) | |||
| Line 118: | Line 118: | ||
==== Consent denied: the user does not explicitly give consent ==== | ==== Consent denied: the user does not explicitly give consent ==== | ||
Should a Nielsen third party cookie (IMRID) already exist, the browser will send that automatically with the ping; in such a case, the flags would instruct the Nielsen backend to drop the cookie information and make no use of it. | Should a Nielsen third party cookie (IMRID) already exist, the browser will send that automatically with the ping; in such a case, the flags would instruct the Nielsen backend to drop the cookie information and make no use of it. | ||
The client needs to add the '''''uoo''''' parameter with its value equal to '''''true''''' in the '''''"vars"''''' section and the request call in the '''''"requests"''''' section. Please do not modify the request call. | |||
'''Request call:''' | |||
<syntaxhighlight lang="html"> | |||
"requests": { | |||
"cloudapi": "https://${prefix}cloudapi.imrworldwide.com/nmapi/v2/${apid}/${sessionId}_${pageViewId}/a?b=%7B%22devInfo%22%3A%7B%22devId%22%3A%22${sessionId}_${pageViewId}%22%2C%22apn%22%3A%22${apn}%22%2C%22apv%22%3A%22${apv}%22%2C%22apid%22%3A%22${apid}%22%2C%22uoo%22%3A%22${uoo}%22%7D%2C%22metadata%22%3A%7B%22static%22%3A%7B%22type%22%3A%22static%22%2C%22section%22%3A%22${section}%22%2C%22assetid%22%3A%22${pageViewId}%22%2C%22segA%22%3A%22${segA}%22%2C%22segB%22%3A%22${segB}%22%2C%22segC%22%3A%22${segC}%22%2C%22adModel%22%3A%220%22%2C%22dataSrc%22%3A%22cms%22%7D%2C%22content%22%3A%7B%7D%2C%22ad%22%3A%7B%7D%7D%2C%22event%22%3A%22playhead%22%2C%22position%22%3A%22${timestamp}%22%2C%22data%22%3A%7B%22hidden%22%3A%22${backgroundState}%22%2C%22blur%22%3A%22${backgroundState}%22%2C%22position%22%3A%22${timestamp}%22%7D%2C%22type%22%3A%22static%22%2C%22utc%22%3A%22${timestamp}%22%2C%22index%22%3A%22${requestCount}%22%2C%22pageURL%22%3A%22${ampdocUrl}%22%7D" | |||
} | |||
</syntaxhighlight> | |||
====== User opted out ====== | ====== User opted out ====== | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="html"><amp-analytics type="nielsen"> | ||
<script type="application/json"> | |||
{ | |||
} | "vars": { | ||
</syntaxhighlight> | "apid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | ||
"prefix": "eu-", | |||
"apv": "1.0", | |||
"apn": "My site", | |||
"section": "EntityName_AMP", | |||
"segA": "NA", | |||
"segB": "NA", | |||
"segC": "Google AMP", | |||
"uoo" : "true" | |||
}, | |||
"requests": { | |||
"cloudapi": "https://${prefix}cloudapi.imrworldwide.com/nmapi/v2/${apid}/${sessionId}_${pageViewId}/a?b=%7B%22devInfo%22%3A%7B%22devId%22%3A%22${sessionId}_${pageViewId}%22%2C%22apn%22%3A%22${apn}%22%2C%22apv%22%3A%22${apv}%22%2C%22apid%22%3A%22${apid}%22%2C%22uoo%22%3A%22${uoo}%22%7D%2C%22metadata%22%3A%7B%22static%22%3A%7B%22type%22%3A%22static%22%2C%22section%22%3A%22${section}%22%2C%22assetid%22%3A%22${pageViewId}%22%2C%22segA%22%3A%22${segA}%22%2C%22segB%22%3A%22${segB}%22%2C%22segC%22%3A%22${segC}%22%2C%22adModel%22%3A%220%22%2C%22dataSrc%22%3A%22cms%22%7D%2C%22content%22%3A%7B%7D%2C%22ad%22%3A%7B%7D%7D%2C%22event%22%3A%22playhead%22%2C%22position%22%3A%22${timestamp}%22%2C%22data%22%3A%7B%22hidden%22%3A%22${backgroundState}%22%2C%22blur%22%3A%22${backgroundState}%22%2C%22position%22%3A%22${timestamp}%22%7D%2C%22type%22%3A%22static%22%2C%22utc%22%3A%22${timestamp}%22%2C%22index%22%3A%22${requestCount}%22%2C%22pageURL%22%3A%22${ampdocUrl}%22%7D" | |||
} | |||
} | |||
</script> | |||
</amp-analytics></syntaxhighlight> | |||
====== Sample Google AMP page ====== | |||
Here is a sample AMP page for Google AMP Nielsen implementation that uses the AMP Consent component. | |||
https://nielsenonlinesupport.com/wilson/ampstatic | |||
AMP Consent component: | |||
<syntaxhighlight lang="html"><script async custom-element="amp-consent" src="https://cdn.ampproject.org/v0/amp-consent-0.1.js"></script></syntaxhighlight> | |||
== Privacy Policy == | == Privacy Policy == | ||
Nielsen uses cookies for browser measurement. In order to comply with our privacy restrictions, we ask that you make a link to our Digital Privacy Policy available on your site. You can find our privacy policy here: https://global.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=it | Nielsen uses cookies for browser measurement. In order to comply with our privacy restrictions, we ask that you make a link to our Digital Privacy Policy available on your site. You can find our privacy policy here: https://global.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=it | ||
Latest revision as of 13:29, 19 January 2026
This guide will show you how to enable Digital Content Ratings (DCR) Static measurement on Google AMP.
Import AMP Analytics Javascript Library
If you have not already, you will need to import the AMP JS library in the <head> of your webpage in order to make an AMP page:
<script async src="https://cdn.ampproject.org/v0.js"></script>
Next, please ensure that the following line is included in the <head> of the webpage:
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
Note: AMP pages require all traffic to be using HTTPS, including the webpage itself
Specify the Analytics Provider
DCR measurement can be added to your AMP pages through the AMP-Analytics element:
<amp-analytics type="nielsen">
<!-- Add Nielsen DCR Tags here -->
</amp-analytics>
For more information on the Analytics type, you can refer to the Analytics vendors section of Google's AMP Developer Documentation.
Configure Metadata
You will need to match the metadata fields on your AMP page with those of your non-AMP page.
Metadata Keys
The Nielsen reserved keys are:
| Key | Description | Example Value | Required |
|---|---|---|---|
| apid | unique ID assigned by Nielsen | XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
✓ |
| prefix | URL prefix to allow EU data collection | eu- | ✓ |
| apv | current version of the Nielsen implementation | 1.0 |
✓ |
| apn | name of the website | My AMP Website |
✓ |
| section | section of the site to be measured | EntityName_AMP |
✓ |
| segA | custom segment to be used to break out reporting | NA |
✓ |
| segB | custom segment to be used to break out reporting | NA |
✓ |
| segC | Reserved custom segment for Google AMP | Google AMP |
✓ |
The values passed through the Nielsen keys will determine the breakouts you will see in reporting. If you decide not to use custom segments A and B, then you do not need to pass a value in these keys. It is suggested you use the same segments used in non-AMP pages.
Note: The value for the 'apid' you pass for AMP measurement should not include the 'P' prefix that is otherwise present on other SDK-related implementations
Metadata for Reporting
You can reference the table to determine how the metadata you pass is used to define your reporting structure:
| Reporting Level | Key | Description |
|---|---|---|
| Brand/Sub-brand | apid | brand and sub-brand are determined by assigned App ID passed during initialization |
| Section | section | section or category for the AMP page |
| Custom Segment A | segA | available segment for custom reporting. Custom segments will roll into the sub-brand |
| Custom Segment B | segB | available segment for custom reporting. Custom segments will roll into the sub-brand |
| Custom Segment C | segC | Custom segment C is reserved for reporting ‘Google AMP’. The Google AMP custom segment will be available under sub-brand and will include the total metrics for all your AMP pages |
If you would like your AMP pages to report into the same reporting structure as your website, we recommend passing the same dynamic metadata in Section, Custom Segment A, and Custom Segment B as you are on your website. This way your AMP pageviews contribute to those aggregations.
Example Implementation
The below is an example implementation of Nielsen measurement on an AMP page:
<amp-analytics type="nielsen">
<script type="application/json">
{
"vars": {
"apid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"prefix": "eu-",
"apv": "1.0",
"apn": "My AMP Website",
"section": "EntityName_AMP",
"segA": "NA",
"segB": "NA",
"segC": "Google AMP"
}
}
</script>
</amp-analytics>
You can find more information about dynamic variables on Google's AMP documentation.
Note: append
#development=1at the end of your URL to see AMP debug logs in the console. This can be helpful when troubleshooting
Static Measurement on Google AMP based on User Consent
This document addresses the handling of personal data collected through the Google AMP Nielsen integration for Audicom in Italy. The document has a specific focus on the implementation of the user consent use cases to collect personal identifiers (IDs) through Google AMP Nielsen measurement based on the user's privacy choice.
Consent granted: the user explicitly accepts
User opted in
<amp-analytics type="nielsen">
<script type="application/json">
{
"vars": {
"apid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"prefix": "eu-",
"apv": "1.0",
"apn": "My AMP Website",
"section": "EntityName_AMP",
"segA": "NA",
"segB": "NA",
"segC": "Google AMP"
}
}
</script>
</amp-analytics>
Consent denied: the user does not explicitly give consent
Should a Nielsen third party cookie (IMRID) already exist, the browser will send that automatically with the ping; in such a case, the flags would instruct the Nielsen backend to drop the cookie information and make no use of it. The client needs to add the uoo parameter with its value equal to true in the "vars" section and the request call in the "requests" section. Please do not modify the request call.
Request call:
"requests": {
"cloudapi": "https://${prefix}cloudapi.imrworldwide.com/nmapi/v2/${apid}/${sessionId}_${pageViewId}/a?b=%7B%22devInfo%22%3A%7B%22devId%22%3A%22${sessionId}_${pageViewId}%22%2C%22apn%22%3A%22${apn}%22%2C%22apv%22%3A%22${apv}%22%2C%22apid%22%3A%22${apid}%22%2C%22uoo%22%3A%22${uoo}%22%7D%2C%22metadata%22%3A%7B%22static%22%3A%7B%22type%22%3A%22static%22%2C%22section%22%3A%22${section}%22%2C%22assetid%22%3A%22${pageViewId}%22%2C%22segA%22%3A%22${segA}%22%2C%22segB%22%3A%22${segB}%22%2C%22segC%22%3A%22${segC}%22%2C%22adModel%22%3A%220%22%2C%22dataSrc%22%3A%22cms%22%7D%2C%22content%22%3A%7B%7D%2C%22ad%22%3A%7B%7D%7D%2C%22event%22%3A%22playhead%22%2C%22position%22%3A%22${timestamp}%22%2C%22data%22%3A%7B%22hidden%22%3A%22${backgroundState}%22%2C%22blur%22%3A%22${backgroundState}%22%2C%22position%22%3A%22${timestamp}%22%7D%2C%22type%22%3A%22static%22%2C%22utc%22%3A%22${timestamp}%22%2C%22index%22%3A%22${requestCount}%22%2C%22pageURL%22%3A%22${ampdocUrl}%22%7D"
}
User opted out
<amp-analytics type="nielsen">
<script type="application/json">
{
"vars": {
"apid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"prefix": "eu-",
"apv": "1.0",
"apn": "My site",
"section": "EntityName_AMP",
"segA": "NA",
"segB": "NA",
"segC": "Google AMP",
"uoo" : "true"
},
"requests": {
"cloudapi": "https://${prefix}cloudapi.imrworldwide.com/nmapi/v2/${apid}/${sessionId}_${pageViewId}/a?b=%7B%22devInfo%22%3A%7B%22devId%22%3A%22${sessionId}_${pageViewId}%22%2C%22apn%22%3A%22${apn}%22%2C%22apv%22%3A%22${apv}%22%2C%22apid%22%3A%22${apid}%22%2C%22uoo%22%3A%22${uoo}%22%7D%2C%22metadata%22%3A%7B%22static%22%3A%7B%22type%22%3A%22static%22%2C%22section%22%3A%22${section}%22%2C%22assetid%22%3A%22${pageViewId}%22%2C%22segA%22%3A%22${segA}%22%2C%22segB%22%3A%22${segB}%22%2C%22segC%22%3A%22${segC}%22%2C%22adModel%22%3A%220%22%2C%22dataSrc%22%3A%22cms%22%7D%2C%22content%22%3A%7B%7D%2C%22ad%22%3A%7B%7D%7D%2C%22event%22%3A%22playhead%22%2C%22position%22%3A%22${timestamp}%22%2C%22data%22%3A%7B%22hidden%22%3A%22${backgroundState}%22%2C%22blur%22%3A%22${backgroundState}%22%2C%22position%22%3A%22${timestamp}%22%7D%2C%22type%22%3A%22static%22%2C%22utc%22%3A%22${timestamp}%22%2C%22index%22%3A%22${requestCount}%22%2C%22pageURL%22%3A%22${ampdocUrl}%22%7D"
}
}
</script>
</amp-analytics>
Sample Google AMP page
Here is a sample AMP page for Google AMP Nielsen implementation that uses the AMP Consent component.
https://nielsenonlinesupport.com/wilson/ampstatic
AMP Consent component:
<script async custom-element="amp-consent" src="https://cdn.ampproject.org/v0/amp-consent-0.1.js"></script>
Privacy Policy
Nielsen uses cookies for browser measurement. In order to comply with our privacy restrictions, we ask that you make a link to our Digital Privacy Policy available on your site. You can find our privacy policy here: https://global.nielsen.com/legal/privacy-principles/digital-measurement-privacy-statement/?lang=it