12 lines
343 B
JavaScript
12 lines
343 B
JavaScript
(function () {
|
|
const script = document.currentScript;
|
|
const id = script && script.getAttribute('data-ga-id');
|
|
if (!id) return;
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(...args) {
|
|
window.dataLayer.push(...args);
|
|
}
|
|
gtag('js', new Date());
|
|
gtag('config', id, { anonymize_ip: true });
|
|
})();
|