The "amp-analytics" element can be used to measure activities in an AMP-document. For example, the following event types are supported:

  • Page call
  • clicks
  • timer
  • scrolling

In this chapter, you will learn how to implement the "amp-analytics" tag for Mapp Intelligence tracking in your AMP pages.

Activate AMP-Analytics

Please include the amp-analytics script in the head-tag to enable tracking for your AMP pages:

Example

<head>
	<!-- ... -->
    <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
XML

Mandatory Configuration

Please note that the tracking information will only be sent after an AMP page has been fully loaded. If the user leaves the page before the pixel has been sent, Mapp Intelligence will not receive any information about the user action. To prevent data loss, please include the Mapp Intelligence analytics tag just before closing the <body> tag.


Account Configuration

After you have made the necessary addition to activate tracking for AMP pages, add the "amp-analytics" tag to your HTML code and make the following settings here:

Example

<body>
	<!-- ... -->
	<amp-analytics type="mapp_intelligence">
		<script type="application/json">
		{
			"vars": {
				"trackDomain": "analytics.mapp.com",
				"trackId": "111111111111111"
			},
			...
		}
		</script>
	</amp-analytics>
</body>
XML
ParameterDescription
trackDomainSpecify your track domain.
trackId

Enter your track ID.

  • Multiple accounts

    If you have booked several accounts with Mapp Intelligence, you can make the tracking information of a website available in several accounts at the same time. As the requests are processed separately, tracking traffic relevant for billing is generated in all accounts supplied.

    If the same information is to be collected in several accounts, you can store the corresponding track IDs of the accounts in an array:

    "trackId": ["111111111111111", "222222222222222"]
    JS

    Another way to share data between accounts is to use data profiles, for example from global accounts to individual country accounts for specific analyses. Find more information here in the section 2.3.

Page Configuration

As a rule, websites consist of individual pages. Visitors navigate between the pages and perform various actions on them.

The unique identification of the individual pages is of central importance in web analytics. Therefore, meaningful naming is the foundation for using Mapp Intelligence effectively. The page names should be unique and provide useful information about the respective page. For example, a comprehensible name for the homepage of a website would be "index" or "home". In addition to such manual naming through the pixel, Mapp can perform automatic naming.

Multiple pages can be combined in content groups to support aggregated analyses. Different page calls for a page can be described in greater detail by transmitting a page parameter.

Page tracking has to be started by calling the corresponding "trigger":

<body>
	<!-- ... -->
	<amp-analytics type="mapp_intelligence">
		<script type="application/json">
		{
			"vars": {
				"trackDomain": "analytics.mapp.com",
				"trackId": "111111111111111",
				"contentId": "de.startpage"
			},
			"triggers": {
				...
				"trackPageview": {
					"on": "visible",
					"request": "pageview"
				},
				... 
			}
		}
		</script>
	</amp-analytics>
</body>
XML
ParameterDescription
trackPageviewThis parameter is used to configure page tracking.
contentId

Optional. You can use this parameter to provide a meaningful, manually created name for the page as analyzed in Intelligence. If you do not set this parameter, an automatic name is used based on the title of the HTML page (<title> tag)