Implementing Quantcast Measure on AMP Project Pages
  • 15 Feb 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Implementing Quantcast Measure on AMP Project Pages

  • Dark
    Light

Article summary

Quantcast is collaborating with Google on their Accelerated Mobile Pages project (AMP for short). AMP is an open source initiative to improve the mobile web experience by allowing web pages to load very quickly on mobile devices. 

Google Tag Manager (GTM)

We recommend GTM users implement the following setup for gaining AMP coverage:

  1. Create an AMP container in GTM.

  2. Add the Tag Manager snippet to your AMP pages.

  3. Configure the Quantcast Measurement tag in your Tag Manager container and publish.


  • Client ID = pcode

  • Labels = Same entry entered in the WEB tag setup, unless the site uses a different label structure for AMP pages.

For more detailed instructions, see Google's AMP & Tag Manager setup guide

AMP-Analytics Tag

If you are unable to pursue the Google Tag Manager method abovepages optimized with AMP HTML can be fully tracked in your existing Quantcast account by adding the appropriate amp-analytics tag into the body of your pages, near the top of the body tag:

<amp-analytics type="quantcast">
<script type="application/json">
{
  "vars": {
  "pcode": "YOUR pcode GOES HERE",
  "labels": ["AMPProject","optionalAdditionalLabelsHere" ]
  }
}
</script>
</amp-analytics>

Note: Please ensure you set the pcode variable above to the appropriate value for your account. The AMPProject label is required. Other labels are optional but recommended – see below.

Labels (Audience Segments) Implementation

One label is required for AMP, and it is the first label in the above snippet, “AMPProject”. Other labels are optional but highly recommended. Labels will function on AMP just like they do on a web or native app. Implementing labels allows you to segment your audience, for example by author or author and article across all your platforms. We highly recommend modifying your label structure so you can drill down to see how the AMP traffic for a given segment may differ in size and audience composition from the non-AMP traffic for the same segment.

For example, you can drill down to authorName > articleName > AMP traffic replacing the optionalAdditionalLabelsHere with the following:

authorName.articleName.AMPProject

Note: To get cross-platform reporting you will need to match the authorName.articleTitle exactly with what you are using in the app and web.

Unique Visitor Duplication When using the AMP Content Delivery Network (CDN), visitor IDs are generated using a different method than that of the standard Quantcast JavaScript tracker. As a result, a unique visitor that visits examplepublisher.com and then views a page on cdn.ampproject.org will be counted as two visitors instead of one. If however, you are hosting AMP pages and not using the AMP CDN, Quantcast will use the existing visitor ID and no duplicate counting will occur.

FAQ

Can I view AMP traffic specifically in Quantcast?
Yes. You can do this by using the labeling approach described above.

Can publishers use macros to populate labels (e.g. if they are already doing this on normal web pages)?
Yes.

Where can I learn more about the AMP project?
https://www.ampproject.org/

Where can I see an example of a properly tagged page? https://github.com/ampproject/amphtml/blob/master/examples/analytics.amp.html

Where can I learn more about AMP Analytics in general?
https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/amp-analytics.md


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Q, facilitating knowledge discovery through conversational intelligence