Resolve GA issues
This commit is contained in:
11
static/assets/js/ga-init.js
Normal file
11
static/assets/js/ga-init.js
Normal file
@@ -0,0 +1,11 @@
|
||||
(function () {
|
||||
var script = document.currentScript;
|
||||
var id = script && script.getAttribute('data-ga-id');
|
||||
if (!id) return;
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
window.dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', id, { anonymize_ip: true });
|
||||
})();
|
||||
Reference in New Issue
Block a user