DCR Static Google AMP Cloud API: Difference between revisions
From Engineering Client Portal
NickParrucci (talk | contribs) |
|||
(15 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb| | {{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR & DTVR}} {{CurrentBreadcrumb}} | ||
[[Category:Digital]] | [[Category:Digital]] | ||
Line 5: | Line 5: | ||
== Import AMP Analytics Javascript Library == | == Import AMP Analytics Javascript Library == | ||
If you have not already, you will need to import the AMP JS library in the <code><head></code> of your webpage in order to make an AMP page: | |||
<syntaxhighlight lang="html"><script async src="https://cdn.ampproject.org/v0.js"></script></syntaxhighlight> | |||
Next, please ensure that the following line is included in the <code><head></code> of the webpage: | |||
<syntaxhighlight lang="html"><script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script></syntaxhighlight> | <syntaxhighlight lang="html"><script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script></syntaxhighlight> | ||
<blockquote>'''Note''': AMP pages require all traffic to be using HTTPS, including the webpage itself</blockquote> | |||
== Specify the Analytics Provider == | == Specify the Analytics Provider == | ||
Line 14: | Line 19: | ||
</amp-analytics></syntaxhighlight> | </amp-analytics></syntaxhighlight> | ||
For more information on the Analytics type, you can refer to the [https://www.ampproject.org/docs/guides/analytics/analytics-vendors | For more information on the Analytics type, you can refer to the [https://www.ampproject.org/docs/guides/analytics/analytics-vendors Analytics vendors] section of Google's AMP Developer Documentation. | ||
== Configure Metadata == | == Configure Metadata == | ||
Line 28: | Line 33: | ||
|- | |- | ||
| apv || current version of the Nielsen implementation || <code>1.0</code> || ✓ | | apv || current version of the Nielsen implementation || <code>1.0</code> || ✓ | ||
|- | |||
| apn || name of the website || <code>My AMP Website</code> || | |||
|- | |- | ||
| section || section of the site to be measured || <code>Entertainment</code> || ✓ | | section || section of the site to be measured || <code>Entertainment</code> || ✓ | ||
Line 35: | Line 42: | ||
| segB || custom segment to be used to break out reporting || <code>News</code> || | | segB || custom segment to be used to break out reporting || <code>News</code> || | ||
|- | |- | ||
| segC || custom segment | | segC || Reserved custom segment for Google AMP || <code>Google AMP</code> || ✓ | ||
|} | |} | ||
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 | 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. | ||
<blockquote>'''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</blockquote> | |||
=== Metadata for Reporting === | === Metadata for Reporting === | ||
Line 47: | Line 54: | ||
! Reporting Level !! Key !! Description | ! Reporting Level !! Key !! Description | ||
|- | |- | ||
| Brand | | 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 | | Section || section || section or category for the AMP page | ||
Line 57: | Line 62: | ||
| Custom Segment B || segB || 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 || 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. | 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 === | === Aggregation Limits === | ||
Line 74: | Line 78: | ||
|- | |- | ||
| 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) | ||
|} | |} | ||
Line 86: | Line 88: | ||
"apid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | "apid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | ||
"apv": "1.0", | "apv": "1.0", | ||
" | "apn": "My AMP Website", | ||
"section": "Entertainment", | |||
"segA": "Music", | "segA": "Music", | ||
"segB": "News", | "segB": "News", | ||
"segC": " | "segC": "Google AMP" | ||
} | } | ||
} | } | ||
</script> | </script> | ||
</amp-analytics></syntaxhighlight> | </amp-analytics></syntaxhighlight> | ||
You can find more information about dynamic variables on [https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#page-and-content Google's AMP documentation]. | |||
<blockquote>'''Note''': append <code>#development=1</code> at the end of your URL to see AMP debug logs in the console. This can be helpful when troubleshooting</blockquote> | |||
== 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: | 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://priv-policy.imrworldwide.com/priv/browser/us/en/optout.html |
Latest revision as of 20:57, 23 February 2023
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 |
✓ |
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 | 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 | 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.
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",
"apn": "My AMP Website",
"section": "Entertainment",
"segA": "Music",
"segB": "News",
"segC": "Google AMP"
}
}
</script>
</amp-analytics>
You can find more information about dynamic variables on Google's AMP documentation.
Note: append
#development=1
at the end of your URL to see AMP debug logs in the console. This can be helpful when troubleshooting
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://priv-policy.imrworldwide.com/priv/browser/us/en/optout.html