Skip to content

Commit 90ace8b

Browse files
author
ghost
committed
new fix
1 parent 7788dcc commit 90ace8b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cookie-consent.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
const gtagScript = document.createElement('script');
4545
gtagScript.async = true;
4646
gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=AW-18022556253';
47-
(document.head || document.documentElement).appendChild(gtagScript);
47+
appendScript(gtagScript);
4848

4949
window.gtag('js', new Date());
5050
window.gtag('config', 'AW-18022556253');
@@ -57,6 +57,7 @@
5757

5858
w.TiktokAnalyticsObject = t;
5959
var ttq = (w[t] = w[t] || []);
60+
6061
ttq.methods = [
6162
'page', 'track', 'identify', 'instances', 'debug',
6263
'on', 'off', 'once', 'ready', 'alias', 'group',
@@ -88,6 +89,9 @@
8889
script.type = 'text/javascript';
8990
script.async = true;
9091
script.src = url + '?sdkid=' + pixelId + '&lib=' + t;
92+
script.onerror = function () {
93+
console.warn('TikTok Pixel script failed to load:', script.src);
94+
};
9195

9296
var firstScript = d.getElementsByTagName('script')[0];
9397
if (firstScript && firstScript.parentNode) {

0 commit comments

Comments
 (0)