Skip to content

Commit

Permalink
# This is a combination of 2 commits.
Browse files Browse the repository at this point in the history
# The first commit's message is:

Adding type='comscore' to <amp-analytics>.

# The 2nd commit message will be skipped:

#	Adding comScore example pageview tracking
  • Loading branch information
acorretti-comscore committed Feb 1, 2016
1 parent 029b2f1 commit 6f57f25
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
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

0 comments on commit 6f57f25

Please sign in to comment.