Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for comScore #1608

Merged
merged 1 commit into from
Feb 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/analytics.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@

<amp-analytics id="analytics3" config="./analytics.config.json"></amp-analytics>

<!-- comScore UDM pageview tracking -->
<amp-analytics type="comscore">
<script type="application/json">
{
"vars": {
"c2": "1000001"
}
}
</script>
</amp-analytics>
<!-- End comScore example -->

<div class="logo"></div>
<h1 id="top">AMP Analytics</h1>

Expand Down
23 changes: 23 additions & 0 deletions extensions/amp-analytics/0.1/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,29 @@ export const ANALYTICS_CONFIG = {
'clt=${contentLoadTime}&dit=${domInteractiveTime}${baseSuffix}'
},
'optout': '_gaUserPrefs.ioo'
},

'comscore': {
'vars': {
'c2': '1000001'
},
'requests': {
'host': 'https://sb.scorecardresearch.com',
'base': '${host}/b?',
'pageview': '${base}c1=2&c2=${c2}&rn=${random}&c8=${title}' +
'&c7=${canonicalUrl}&c9=${documentReferrer}&cs_c7amp=${ampdocUrl}'
},
'triggers': {
'defaultPageview': {
'on': 'visible',
'request': 'pageview'
}
},
'transport': {
'beacon': false,
'xhrpost': false,
'image': true
}
}
};

1 change: 1 addition & 0 deletions extensions/amp-analytics/amp-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ when the document is first loaded, and each time an `<a>` tag is clicked:

- `type` This optional attribute can be specified to use one of the built-in analytics providers. Currently supported values for type are:
- `googleanalytics`: Adds support for Google Analytics. More details for adding Google Analytics support can be found at [developers.google.com](https://developers.google.com/analytics/devguides/collection/amp-analytics/).
- `comscore`: Supports comScore Unified Digital Measurement™ pageview analytics. Requires defining *var* `c2` with comScore-provided *c2 id*.

```
<amp-analytics type="XYZ"> ... </amp-analytics>
Expand Down