Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
Release 2.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGibson27 committed Dec 23, 2020
1 parent 68afed2 commit a88f93d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions analytics/2.8.2/pixel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(function () {
var win = window;

if (!win.ttDotTracked) {
var doc = document;
var e = encodeURIComponent;
var attr = 'data-dot-token';
var loc = win.location;
var currentScript = doc.querySelector('script[' + attr + ']');
var scriptSrcParts = currentScript.src.split('/');

var img = new win.Image(1, 1);
var imgSrc = scriptSrcParts[0] + '//' + scriptSrcParts[2] + '/pixel.gif?';
var domain = e(loc.hostname);
var token = e(currentScript.getAttribute(attr) || '');

imgSrc += 'token=' + token + '&';
imgSrc += 'domain=' + domain;

img.src = imgSrc;
win.ttDotTracked = true;
}
})();
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dot",
"description": "The Texas Tribune's pixel tracking tool",
"version": "2.8.1",
"version": "2.8.2",
"scripts": {
"build": "npm run build:dashboard && npm run build:server",
"build:dashboard": "rimraf dist && NODE_ENV=production webpack",
Expand Down

0 comments on commit a88f93d

Please sign in to comment.