DCR Static Google AMP Cloud API: Difference between revisions
From Engineering Client Portal
Line 68: | Line 68: | ||
|- | |- | ||
| segB || total sum of segA, segB, and segC must be a maximum of 24 unique values (segA + segB + segC <= 24) | | segB || total sum of segA, segB, and segC must be a maximum of 24 unique values (segA + segB + segC <= 24) | ||
|} | |} | ||
Revision as of 00:17, 27 June 2017
This guide will show you how to enable Digital Content Ratings (DCR) Static measurement on Google AMP.
Import AMP Analytics Javascript Library
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>
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 |
✓ |
apv | current version of the Nielsen implementation | 1.0 |
✓ |
section | section of the site to be measured | Entertainment |
✓ |
segA | custom segment to be used to break out reporting | Music |
|
segB | custom segment to be used to break out reporting | News |
|
segC | Reserved custom segment for Google AMP | '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.
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 |
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.
Aggregation Limits
There are limits on the number of unique values that can be aggregated on in reporting. The specific limitations by key are:
Key | Aggregation Limit |
---|---|
section | maximum of 25 unique values (section <= 25) |
segA | total sum of segA, segB, and segC must be a maximum of 24 unique values (segA + segB + segC <= 24) |
segB | total sum of segA, segB, and segC must be a maximum of 24 unique values (segA + segB + segC <= 24) |
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",
"apv": "1.0",
"section": "Entertainment",
"segA": "Music",
"segB": "News",
"segC": "Branded_Content"
}
}
</script>
</amp-analytics>
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: http://www.nielsen.com/digitalprivacy#choice