How to restrict tracking calls from domains other than you own?

Avatar

Avatar

zahid15001577

Avatar

zahid15001577

zahid15001577

03-12-2020

Since Adobe Analytics has front-end implementation, anyone can copy your tracking script or entire page source and use it on their domain. How to prevent tracking calls made from domain other than you own. May be something like not considering those calls so as to save tracking call cost and keep the data clean?

Thank you,

Adobe Analytics
View Entire Topic

Avatar

Avatar

evolytics_brian

Avatar

evolytics_brian

evolytics_brian

03-12-2020

I'd go with something like this...

function checkValidDomains(host) {
  var validDomains = ['x.example.com', 'y.example.com'];
  if (!(validDomains.indexOf(host) > -1)) {
    s.abort = true;
  }
}

s.doPlugins = function (s) {
  checkValidDomains(document.location.hostname);
};

If you don't already have doPlugins set up in Launch (or your AppMeasurement.js library), it's easy to do, and if someone happens to copy and use your analytics script verbatim, you'd be covered on ALL analytics calls. No need for rule-specific conditions or anything more complicated.