feat: complete scheduled publishing, security remediation and DEV_TICKETS implementation
This commit is contained in:
1 parent
d6d4158cbe
commit
efb3c473c4
35 files changed
+685
-185
No files matched your search
@@ -39,19 +39,23 @@ export default function AnalyticsDeferred({ gtmId, gaId, clarityId }: AnalyticsD
|
||||
document.head.appendChild(gtmScript);
|
||||
}
|
||||
|
||||
// 2. Google Analytics 4 (if standalone without GTM)
|
||||
if (gaId && !gtmId) {
|
||||
// 2. Google Analytics 4 (ensures GA4 hits fire directly even if GTM container lacks GA4 config tag)
|
||||
if (gaId) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(...args: any[]) {
|
||||
window.dataLayer?.push(args);
|
||||
}
|
||||
(window as any).gtag = gtag;
|
||||
gtag('js', new Date());
|
||||
gtag('config', gaId, { page_path: window.location.pathname });
|
||||
|
||||
const gaScript = document.createElement('script');
|
||||
gaScript.async = true;
|
||||
gaScript.src = `https://www.googletagmanager.com/gtag/js?id=${gaId}`;
|
||||
document.head.appendChild(gaScript);
|
||||
// Only append gtag.js script if not already added
|
||||
if (!document.querySelector(`script[src*="${gaId}"]`)) {
|
||||
const gaScript = document.createElement('script');
|
||||
gaScript.async = true;
|
||||
gaScript.src = `https://www.googletagmanager.com/gtag/js?id=${gaId}`;
|
||||
document.head.appendChild(gaScript);
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Microsoft Clarity
|
||||
|
||||
Reference in new issue
Block a user