mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-09 20:55:06 +02:00
Add Google Tag Manager for Web Cloud Build (#3173)
* add gtm for cloud build * update github workflow
This commit is contained in:
@@ -65,6 +65,7 @@ jobs:
|
|||||||
NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.POSTHOG_KEY }}
|
NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.POSTHOG_KEY }}
|
||||||
NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.POSTHOG_HOST }}
|
NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.POSTHOG_HOST }}
|
||||||
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }}
|
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }}
|
||||||
|
NEXT_PUBLIC_GTM_ENABLED=true
|
||||||
# needed due to weird interactions with the builds for different platforms
|
# needed due to weird interactions with the builds for different platforms
|
||||||
no-cache: true
|
no-cache: true
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
@@ -6,6 +6,7 @@ import {
|
|||||||
} from "@/components/settings/lib";
|
} from "@/components/settings/lib";
|
||||||
import {
|
import {
|
||||||
CUSTOM_ANALYTICS_ENABLED,
|
CUSTOM_ANALYTICS_ENABLED,
|
||||||
|
GTM_ENABLED,
|
||||||
SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED,
|
SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED,
|
||||||
} from "@/lib/constants";
|
} from "@/lib/constants";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
@@ -21,6 +22,7 @@ import { getCurrentUserSS } from "@/lib/userSS";
|
|||||||
import CardSection from "@/components/admin/CardSection";
|
import CardSection from "@/components/admin/CardSection";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import PostHogPageView from "./PostHogPageView";
|
import PostHogPageView from "./PostHogPageView";
|
||||||
|
import Script from "next/script";
|
||||||
|
|
||||||
const inter = Inter({
|
const inter = Inter({
|
||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
@@ -80,6 +82,22 @@ export default async function RootLayout({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{GTM_ENABLED && (
|
||||||
|
<Script
|
||||||
|
id="google-tag-manager"
|
||||||
|
strategy="afterInteractive"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: `
|
||||||
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
|
})(window,document,'script','dataLayer','GTM-PZXS36NG');
|
||||||
|
`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</head>
|
</head>
|
||||||
<body className={`relative ${inter.variable} font-sans`}>
|
<body className={`relative ${inter.variable} font-sans`}>
|
||||||
<div
|
<div
|
||||||
|
@@ -60,6 +60,9 @@ export const CUSTOM_ANALYTICS_ENABLED = process.env.CUSTOM_ANALYTICS_SECRET_KEY
|
|||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
|
export const GTM_ENABLED =
|
||||||
|
process.env.NEXT_PUBLIC_GTM_ENABLED?.toLowerCase() === "true";
|
||||||
|
|
||||||
export const DISABLE_LLM_DOC_RELEVANCE =
|
export const DISABLE_LLM_DOC_RELEVANCE =
|
||||||
process.env.DISABLE_LLM_DOC_RELEVANCE?.toLowerCase() === "true";
|
process.env.DISABLE_LLM_DOC_RELEVANCE?.toLowerCase() === "true";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user