Basic integration
The etracker tracking code is required so that etracker can determine the usage data of the website (e.g. visitors and page views).
The tracking code must be integrated once into all pages of your website to be measured.
This completes the basic integration and the following is recorded automatically:
- All page views with page title and URL (without URL parameters) with dwell time to the second and assignment to the navigation areas according to the URL structure
- All external link calls, download clicks and scroll events
- Videos, podcasts, music (playable media)
- Use of the internal search after defining the search parameter
- Allocation of visits by medium (type-in, SEO/SEA, social media, referrer)
- Google Analytics (UTM) campaign parameters (as origin, medium, campaign)
- All organic referrers (domain and path)
Optionally, you can also fill in the etracker parameters contained in the tracking code.
For special evaluations and reports, additional data can be transferred via interfaces, which must also be integrated into the website to be measured. The following interfaces are available:
- JavaScript wrapper for recording data independently of a page impression (e.g. recording Ajax requests).
- E-commerce API for recording product performance data, orders and transferring new order statuses (cancelation, lead to sales).
Your tracking code
The tracking code contains a unique key value for each account. Your personal tracking code will be displayed after you log in for the first time. You can also find it at any time under Integration → Website code.
Insert tracking code
Standard integration
In order for etracker to collect the data from your website, the tracking code must be inserted within the HTML source code on all pages of your website to be measured or in the template of your content management or store system between the opening <head>
tag and the closing </head>
tag.
If you use the etracker optimizer, we recommend inserting the tracking code directly after the opening <head>
tag or as close to it as possible to minimize flickering effects when a page is called up.
The tracking code is structured as shown in the example below:
<!-- Copyright (c) 2000-2021 etracker GmbH. All rights reserved. -->
<!-- This material may not be reproduced, displayed, modified or distributed -->
<!-- without the express prior written permission of the copyright holder. -->
<!-- etracker tracklet 5.0 -->
<script type="text/javascript">
// var et_pagename = "";
// var et_areas = "";
// var et_tval = 0;
// var et_tsale = 0;
// var et_tonr = "";
// var et_basket = "";
</script>
<script id="_etLoader" type="text/javascript" charset="UTF-8" data-block-cookies="true" data-respect-dnt="true" data-secure-code="XXXXX" src="//code.etracker.com/code/e.js" async></script>
<!-- etracker tracklet 5.0 end -->
In accordance with the EU directive, the parameter data-block-cookies=“true“
in the tracking code ensures that no etracker cookies are set by default.
Optionally, you can integrate the function for activating etracker cookies in your cookie notice to enable the setting of etracker cookies with consent.
If you are using a common consent management solution, follow these instructions for the interaction so as not to incorrectly block cookie-less tracking.
After installing the tracking code, etracker immediately starts tracking your website.
Integration into content management and store systems
For content management or store systems, the tracking code should be generated manually once and then inserted into the layout template. The parameters of the tracking code should then be transferred using variables of the content management or store system.
We also provide plugins for the most common store systems.
Install integration with security headers
To increase the security of web applications, it is good practice to use HTTP security headers. This includes the Content-Security-Policy
header (CSP).
To use the tracking code on a server with activated CSP, the CSP header for etracker must be supplemented as follows:
Header set Content-Security-Policy "script-src 'self' https://*.etracker.com https://*.etracker.de 'unsafe-inline'; connect-src https://*.etracker.de; img-src 'self' https://*.etracker.com https://*.etracker.de"
When using the scrollmap, embedding in an iframe should also be permitted:
Header set Content-Security-Policy "frame-ancestors https://*.etracker.com; script-src 'self' https://*.etracker.com https://*.etracker.de 'unsafe-inline'; connect-src https://*.etracker.de; img-src 'self' https://*.etracker.com https://*.etracker.de"
The “unsafe-inline
” restriction can be removed if the etracker parameter block in the website and the CSP are provided with the same randomly generated nonce when the page is delivered.
Tracking code for Google AMP pages
With etracker, it is also possible to track visitors, page impressions (PIs), dwell time as well as entries and exits on AMP pages at . To do this, the page must be adjusted at a maximum of two locations.
First, amp-analytics must be integrated. To do this, the corresponding script is loaded in the HTML by adding a script element in the head element:
<head>
<script async
custom-element="amp-analytics"
src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js">
</script>
</head>
If several analysis tools are used at the same time (e.g. etracker and Google Analytics), the script only needs to be loaded once. Then amp-analytics is integrated in the body element with the etracker configuration.
<body>
<amp-analytics config="https://code.etracker.com/amp-config.json.php">
<script type="application/json">
{
"vars": {
"areas": "AMP-Beispielbereich",
"et": "M632hA",
"pagename": "AMP-Beispielseite"
}
}
</script>
</amp-analytics>
</body>
In the above code section, the values for the parameters areas
, et
and pagename
must be assigned per page as described in the table below:
Parameter | Beschreibung | Erforderlich? |
---|---|---|
et | Account-Schlüssel (eindeutig pro Account) | ja |
pagename | Name, unter dem die Seite in etracker zu finden ist. Wenn nicht gesetzt, wird die URL der Seite dafür verwendet. | nein |
areas | Bereiche, denen die Seite zugeordnet ist. | nein |