Table of Contents

Analytics: Installing DataFeedWatch Tag in Google Tag Manager

DataFeedWatch Updated by DataFeedWatch

To install DataFeedWatch Tag in Google Tag Manager, follow the steps below:

Create a Variable:

  1. In Google Tag Manager, go to Variables
  2. To create a new one, in User-Defined Variables section click New
  3. Change the name to dfwTrackerVar, and click on the image below it
  4. From the list of variable types, select Custom JavaScript
  5. In the new window, paste the following code, and hit Save
function dfwTracker() {
var r = function() {
var r = /dfw_tracker=([0-9a-zA-Z\-\_]+)/.exec(location.href);
null !== r && g(r[1]) && (r = r[1]);
return r
}();
if ("string" == typeof r) {
var t = function() {
var r = "_dfwt",
t = n(r);
g(t) || (t = function() {
function r() {
return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1)
}
return "dfwt" + r() + r() + r() + r() + r() + r()
}(), n(r, t));
return t
}(),
e = "dfw_tracker=" + t + "-" + r;
return i('init {"gtag": true, "value": "' + e + '", "v": "1.1"}'), e
}

function n(r, t) {
var e = document;
if (g(t)) {
var n = new Date;
return n.setTime(n.getTime() + 63072e6), e.cookie = [r, "=", t, "; expires=" + n.toUTCString(), "; path=/"].join("")
}
for (var i, o, a, c = r ? void 0 : {}, f = e.cookie ? e.cookie.split("; ") : [], u = 0, l = f.length; u < l; u++) {
if (o = (i = f[u].split("=")).shift(), a = i.join("="), r && r === o) {
c = d(a);
break
}!r && g(a = d(a)) && (c[o] = a)
}
return c
}

function d(r) {
0 === r.indexOf('"') && (r = r.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\"));
try {
return r.replace(/\+/g, " ")
} catch (r) {}
return ""
}

function g(r) {
return null !== r && void 0 !== r
}

function i(r) {
! function(r, t) {
-1 < location.href.indexOf("dfw_tracker_debug=1") && console.log("[dfw_tracker][" + r + "]", t)
}("event", r)
}
i('missing "dfw_tracker" param')
}

Edit Your Universal Analytics Tag:

  1. In Google Tag Manager, go to Tags
  2. To open your current Universal Analytics Tag, click on it, and click on Tag Configuration
    Note that this should be the Tag declared in the installation process in DataFeedWatch.
  3. Click More Settings > Custom Dimensions > Add Custom Dimension
  4. Set Index to the custom dimension index from the installation page in DataFeedWatch, and Dimension Value to {{dfwTrackerVar}}
    You'll find the custom dimension index in the last step of our installation.
  5. Hit Save
  6. To publish the new settings, click Submit > Publish
  7. To check the results, click Validate in the installation process in DataFeedWatch
  8. Click Finish to save your changes and complete the process
    Now you'll need to wait a minute before we collect your data. We'll show you the details in your Analytics dashboard as soon as we get some product data.

Contact

Powered by HelpDocs (opens in a new tab)

Powered by HelpDocs (opens in a new tab)