AMP tracking

For the following integration to work, you must add the amp-analytics module on the page environment.

Here is an example of the AMP tag:

<amp-analytics type="mediarithmics">
  <script type="application/json">
    {
      "vars": {
        "site_token": <SITE_TOKEN>,
        "event_name": "amp-test-pageview"
      },
      "extraUrlParams": {
        "prop1": "value1",
        "prop2": "value2"
      }
    }
  </script>
</amp-analytics>

Arguments

name

type

description

site_token

string

site_token is the token of the website (required).

event_name

string

event_name is the name of the event (optional, default to '$page_view').

any custom property

string

All custom properties should be added to the extraUrlParams object (prop1, prop2 in the example).

Last updated