All Collections
Prepare
Setting up tracking and analytics
Google Analytics
[UA]: Cross-domain visitor tracking (non-branded domains)
[UA]: Cross-domain visitor tracking (non-branded domains)

How to enable cross-domain visitor tracking for non-branded domains.

Updated over a week ago

🔰 Before we get started

If you're using a branded domain, and are serving your iPaper publications from a subdomain (Example: catalogs.YourDomain.com), you can skip this guide entirely! This is because Google Analytics tracks sessions across subdomains out of the box if you're using their default tracking script.

Cross-domain visitor tracking in iPaper

If you'd like to be able to track your visitors' journeys from Flipbook to website, or the other way around, there are a few extra steps you need to take to enable this excellent feature.

1. Add the domain you want to share visitor data with.

For cross-domain tracking to work, we need to know what domains you want to share visitor data with. This is a security measure set in place by Google, so only domains that trust each other, share data with each other. The domain or domains we need to know about will all be tracked to the same property as the iPaper publications.

2. Enable Cross-domain on your website.

Out of the box, Google Analytics doesn’t have Cross-domain tracking enabled, but with the official plugin linker from Google, we can enable this functionally.

To enable Cross-domain tracking support on your domain you need to tweak your  tracking script a bit. If you’re comfortable doing this yourself, awesome! However, if you're not completely sure how to do this, you probably want to forward this guide to the person who normally handles your tracking scripts updates.

Here's what needs to change in the Google Analytics code found on your website.

ga('create', 'UA-XXXXX-Y', 'auto', {allowLinker: true});
ga('require', 'linker');
ga('linker:autoLink', ['viewer.ipaper.io']);

Let's break down this snippet so we know what's happening:

Line 1: ga('create', 'UA-XXXXX-Y', 'auto', {allowLinker: true});

Here we tell the Analytics script that we want it to look for a  clientID in the URL, and use it if it's present.

Line 2: ga('require', 'linker');

Here we load the linker plugin, which is required for this to work.

Line 3: ga('linker:autoLink', ['viewer.ipaper.io']);

And lastly, we tell the script to tag all flipbooks links with a client-ID. This is required so we, in the flipbook, can identify the user and continue his session in the flipbook.

To read more about the linker plugin and what it does, go to the official linker documentation.

If you're having trouble getting the script to load correctly, please contact us at support@ipaper.io and we'll assist however we can.

3. Exclude the iPaper viewer domain from referrers

All domains that are part of the cross-domain setup should be excluded as a referrer, as not doing this, will cause a discrepancy between you sessions and referrers. Google offers a helpful guide to help you set this up.

With this now in place, you will see that visitors on your Flipbooks will be tracked across the domains, and will be identified as the same visitor when they hit your domain.

We hope you found this helpful! 😀

Did this answer your question?