Load analytics.js from your own domain

Ole Dallerup Updated by Ole Dallerup

About 30% of all internet users have installed an ad-blocker on their browser. By loading your analytics script from your own domain you are minimizing the risk of ad-blockers blocking the script from being loaded. This way you get to see the traffic from users who are using ad-blockers which will give you insights you didn't have access to before.

How much you are currently impacted by ad-blockers depends on the location of your visitors and details around the persona you are selling towards. Generally, we have experienced that the more technical (example software engineers) your visitors are the more likely it is they have an ad-blocker installed. 

In June 2020 on dreamdata.io, 10% of visitors were using an ad-blockers.

For more details read here.

Setup
  1. To set up your own domain for loading analytics you first have to pick a sub domain example dda.company.com.
    When you have done that you should set up the following CNAME:
    {your-selected-domain.company.com} -> {slug}.customers.dreamdata.cloud
    You will see your slug by logging into your app.dreamdata.io and looking in the url.
  1. Reach out to us at friends@dreamdata.io (be sure to share {your-selected-domain.company.com} with us). We will have to configure something at our end to make SSL work.
    After that, we will come back to you with an updated script for you to update on your website or inside Google Tag Manager (note if you use GTM you should read a bit further).
What if I’m using Google Tag Manager?

If you are using Google Tag Manager then you need to also load the GTM script from a separate domain to avoiding ad-blockers from blocking it and thereby blocking the Dreamdata.io script. We have however made it easy and if you have already done the setup then all you have to do is to replace googletagmanager.com with the domain from where you will load your analytics {your-selected-domain.company.com}/gtm as the example below and your GTM script won’t be blocked by ad-blockers.

We recommend always taking the script from Google Tag Manager for the latest version.

<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});varf=d.getElementsByTagName(s[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://{your-selected-domain.company.com}/gtm/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-W882CWN');</script>

Note: Where this will ensure that your GTM script is loaded even when an ad-blocker is installed, it does not prevent scripts loaded by GTM from being blocked by ad-blockers. This could be Google Analytics, Facebook Ads etc.

What if I'm using Segment.com?

Segment.com has a solution for this as well. Reach out to segment at friends@segment.com for more information.

How did we do?

How does Dreamdata track all relevant on-site customer data?

Pardot iframe form tracking

Contact