Files
linkspin/public/p.js
T

14 lines
1007 B
JavaScript

/* LinkSpin audience pixel. One line on any page you control:
<script async src="https://linkspin.app/p.js" data-aud="la-xxxxxx"></script>
Adds the visitor to that audience for 30 days so your LinkSpin campaigns can target (or exclude) them. Optional
data-ev="lead" names the event. It stores a random visitor id cookie on linkspin.app and nothing else. */
(function () {
var s = document.currentScript; if (!s) return;
var a = s.getAttribute('data-aud') || ''; if (!/^la-[a-f0-9]{6}$/.test(a)) return;
var base = (s.src || '').replace(/\/p\.js.*$/, '');
var e = s.getAttribute('data-ev') || '';
var q = 'a=' + encodeURIComponent(a) + (e ? '&e=' + encodeURIComponent(e.slice(0, 24)) : '')
+ '&u=' + encodeURIComponent(String(location.href).slice(0, 300)) + '&r=' + encodeURIComponent(String(document.referrer).slice(0, 200)) + '&t=' + Date.now();
var img = new Image(1, 1); img.alt = ''; img.referrerPolicy = 'strict-origin-when-cross-origin'; img.src = base + '/p.gif?' + q;
})();