Updated by Amalie
Website Implementation - how to measure Media
Measurement on websites will happen on multiple levels. The publishers script will be used for measurement on all Networks and Media belonging to your Publishers Group.
For measurement on section level for media with sections, you will need to implement section definitions in addition to the Publisher script. For media with no sections, implementing the Publishers script will be sufficient.
Publisher Script implementation
To enable measurement on your website(s), you will need to implement the Publisher Script - an example is provided below:
<script src="https://sak.userreport.com/publisherID/launcher.js?iab_consent=BOv_CmhOv_CmhAAABBENDAiAAAAYqABAMUA" async id="userreport-launcher-script"></script>
You will find a guide on where to retrieve this ID in the Where to find your measurement script and identifiers article.
The Publisher Script is lightweight, asynchronous and non-blocking. It is hosted on a decentralised content delivery network, and compatible with single-page applications.
Publisher Script execution flow explained
We recommend that the Publisher Script is to be loaded after all main content is loaded.
The Publisher Script identifies automatically what media it is running on and will then send a pageview measurement request to our measurement service.
In order to support single-page applications, the Publisher Script also observes the URL for changes that might happen without a prior page reload in order to send additional pageview measurement requests to our measurement service.
The Publisher Script also detects tab visibility changes and will send additional pageview measurement requests if the browser-tab was reactivated after defined time-interval have passed since the last interaction
You can either implement the Publisher Script directly on the website(s) or use your preferred tag manager for script deployment. You'll find guides for both cases in the below.
About Single Page Applications (SPAs)
In order to support single-page applications, the Publisher Script observes the URL for changes that might happen without a prior page reload in order to send additional pageview measurement requests to our measurement service.
The script only observes changes in the pathname parts, not the search or hash part as that is used for anchor links. Therefore, if your SPA needs to measure page views upon hash changes in the URL, you need to execute the following calls manually.
For measuring a page view:
For measuring a section view:
Implementation directly on website
In order to do an implementation directly on your website you will have to paste the Publisher Script into the template of every page on your site right before the closing Html </body> tag.
It is fairly simple if you are familiar with HTML and templating. On most websites, you just have to paste the Publisher Script into one single template in order for the script to appear on all pages of the website - much like it's the case with implementing Google Analytics scripts.
Direct implementation (example):
<content>.... </content><script src="https://sak.userreport.com/publisherID/launcher.js?iab_consent=BOv_CmhOv_CmhAAABBENDAiAAAAYqABAMUA" id="userreport-launcher-script" async></script>
Implementation through a Tag Manager (GTM example)
If you are using Google Tag Manager to handle scripts and tags on your website, you can also install the Publisher Script through Google Tag Manager.
- Go to your Google Tag Manager account and add a new tag:
- Name the new tag “AudienceProject Tag”, and select the tag type UserReport:
- Type in your Publisher ID:
- On the Advanced Settings page, set tag firing options to once per page:
- Set the tag trigger to DOM ready on All Pages:
- Please make sure to verify correct implementation of the script by following the guide How to check and verify your website implementation
- Want to measure your sections too? Go to Website implementation / Sections