gated tracking
This commit is contained in:
parent
1c43296c85
commit
17b6e14f34
|
|
@ -672,7 +672,8 @@
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
var h = location.hostname;
|
var h = location.hostname;
|
||||||
if (h !== 'notediscovery.com' && !h.endsWith('.notediscovery.com')) return;
|
window.__analyticsEnabled = (h === 'notediscovery.com' || h.endsWith('.notediscovery.com'));
|
||||||
|
if (!window.__analyticsEnabled) return;
|
||||||
|
|
||||||
var GA_ID = 'G-2TVGZ9N7LF';
|
var GA_ID = 'G-2TVGZ9N7LF';
|
||||||
var s = document.createElement('script');
|
var s = document.createElement('script');
|
||||||
|
|
@ -1204,6 +1205,8 @@
|
||||||
|
|
||||||
// Reads data-track / data-track-* attributes for declarative wiring.
|
// Reads data-track / data-track-* attributes for declarative wiring.
|
||||||
(function () {
|
(function () {
|
||||||
|
if (!window.__analyticsEnabled) return;
|
||||||
|
|
||||||
function track(event, params) {
|
function track(event, params) {
|
||||||
if (typeof gtag !== 'function') return;
|
if (typeof gtag !== 'function') return;
|
||||||
gtag('event', event, params || {});
|
gtag('event', event, params || {});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue