NonplayerCharacter

Google Analytics | Pretty-print the tracker

Nov 30th, 2018
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. JSON.stringify(window.gaObj.getAll()[0],true,"\t")
  2. // in default implementation 'gaObj' should be replaced with 'ga'
  3. /*
  4. // Sample output:
  5. {
  6.     "a": {
  7.         "data": {
  8.             "keys": [
  9.                 "_cd2l",
  10.                 "_dt",
  11.                 "_gclid",
  12.                 "_gclsrc",
  13.                 "_gcn",
  14.                 "_gid",
  15.                 "_gt",
  16.                 "_hc",
  17.                 "_j1",
  18.                 "_j2",
  19.                 "_oot",
  20.                 "_r",
  21.                 "_rlt",
  22.                 "_s",
  23.                 "_ti",
  24.                 "_ti",
  25.                 "_to",
  26.                 "_utma",
  27.                 "_utmht",
  28.                 "_utmz",
  29.                 "adSenseId",
  30.                 "allowAnchor",
  31.                 "allowLinker",
  32.                 "alwaysSendReferrer",
  33.                 "apiVersion",
  34.                 "buildHitTask",
  35.                 "ceTask",
  36.                 "checkProtocolTask",
  37.                 "checkStorageTask",
  38.                 "clientId",
  39.                 "clientIdTime",
  40.                 "clientVersion",
  41.                 "cookieDomain",
  42.                 "cookieDomain",
  43.                 "cookieExpires",
  44.                 "cookieName",
  45.                 "cookiePath",
  46.                 "cookieUpdate",
  47.                 "customTask",
  48.                 "devIdTask",
  49.                 "dimension1",
  50.                 "dimension10",
  51.                 "dimension2",
  52.                 "dimension8",
  53.                 "dimension9",
  54.                 "displayFeaturesTask",
  55.                 "encoding",
  56.                 "flashVersion",
  57.                 "historyImportTask",
  58.                 "hitCallback"
  59.                 "hitPayload",
  60.                 "hitType",
  61.                 "javaEnabled",
  62.                 "language",
  63.                 "legacyCookieDomain",
  64.                 "legacyHistoryImport",
  65.                 "location",
  66.                 "name",
  67.                 "page",
  68.                 "previewTask",
  69.                 "referrer",
  70.                 "sampleRate",
  71.                 "samplerTask",
  72.                 "screenColors",
  73.                 "screenResolution",
  74.                 "sendHitTask",
  75.                 "siteSpeedSampleRate",
  76.                 "storage",
  77.                 "storeGac",
  78.                 "storedClientId",
  79.                 "timingTask",
  80.                 "trackingId",
  81.                 "transportUrl",
  82.                 "usage",
  83.                 "useAmpClientId",
  84.                 "userId",
  85.                 "validationTask",
  86.                 "viewportSize",
  87.             ],
  88.             "values": {
  89.                 ":_gclid": "",
  90.                 ":_gclsrc": "",
  91.                 ":_gcn": "_gid",
  92.                 ":_gid": "19********2.15********5",
  93.                 ":_gt": 15********0,
  94.                 ":_hc": 1,
  95.                 ":_s": 1
  96.                 ":_ti": 15*********9,
  97.                 ":_to": 19,
  98.                 ":_utma": "10********1.20********8.15********5.15********0.15********0.1",
  99.                 ":_utmz": "10********1.15********0.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)",
  100.                 ":adSenseId": 14********8,
  101.                 ":apiVersion": 1,
  102.                 ":clientId": "20********8.15********5",
  103.                 ":clientVersion": "j72d",
  104.                 ":cookieDomain": "site.com",
  105.                 ":dimension10": "xxxxx",
  106.                 ":dimension8": "xxxxx",
  107.                 ":dimension9": "xxxxx<20******8.15*******5",
  108.                 ":encoding": "UTF-8",
  109.                 ":javaEnabled": false,
  110.                 ":language": "en-us",
  111.                 ":location": "https://site.com",
  112.                 ":name": "MyTrackerName", // tracker name
  113.                 ":screenColors": "24-bit",
  114.                 ":screenResolution": "1920x1080",
  115.                 ":storedClientId": "20*****8.15******5",
  116.                 ":trackingId": "UA-12345678-9",
  117.                 ":viewportSize": "1904x950",
  118.             },
  119.             "u": {},
  120.             "debug": true
  121.         }
  122.     },
  123.     "filters": {
  124.         "m": [
  125.             "_oot",
  126.             "customTask",
  127.             "previewTask",
  128.             "checkProtocolTask",
  129.             "validationTask",
  130.             "checkStorageTask",
  131.             "historyImportTask",
  132.             "samplerTask",
  133.             "_rlt",
  134.             "ceTask",
  135.             "devIdTask",
  136.             "displayFeaturesTask",
  137.             "buildHitTask",
  138.             "_dt",
  139.             "sendHitTask",
  140.             "timingTask"
  141.         ]
  142.     },
  143.     "L": true
  144. }
  145. */
Add Comment
Please, Sign In to add comment