Website implementation / Media

Amalie Updated by Amalie

Website Implementation - how to measure Media

Note that you must have prepared your account and created at least Media entities in your account for the website(s) you wish to measure

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>

Where the “publisherID” is replaced with the publisher specific ID provided in your account.

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.

Please note that for the FIAM Media Metrics measurement solution specifically a hard-coded consent string has been added to the script. It is therefore very important that the example above containing this consent string is used, and not the script available on your account as this version does not include the hardcoded FIAM consent string.

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:  

window._urq.push(["trackPageview"]);

For measuring a section view:  

window._urq.push(["trackSectionPageView", sectionId]);

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):

<body>

<content>.... </content><script src="https://sak.userreport.com/publisherID/launcher.js?iab_consent=BOv_CmhOv_CmhAAABBENDAiAAAAYqABAMUA" id="userreport-launcher-script" async></script>

</body>

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.

  1. Go to your Google Tag Manager account and add a new tag:

  1. Name the new tag “AudienceProject Tag”, and select the tag type UserReport:

  1. Type in your Publisher ID:

  1. On the Advanced Settings page, set tag firing options to once per page:

  1. Set the tag trigger to DOM ready on All Pages:

  1. Please make sure to verify correct implementation of the script by following the guide How to check and verify your website implementation
  2. Want to measure your sections too? Go to Website implementation / Sections

How did we do?

Website implementation / How to manage consent implementation

Website implementation / Sections

Contact