Skip to content

Commit

Permalink
chore(console): adds google conversion tag
Browse files Browse the repository at this point in the history
  • Loading branch information
poolsar42 committed Jul 28, 2023
1 parent f4032ce commit 1f8d69b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/console/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ export default function App() {
<Links />
</head>
<body className="h-full">
{!GATag ? null : (
{GATag && (
<>
{/* <!-- Google tag (gtag.js) --> */}
<script
async
src={`https://www.googletagmanager.com/gtag/js?id=${GATag}`}
Expand Down Expand Up @@ -277,6 +278,7 @@ export default function App() {
<Outlet
context={{
apps,
ENV: loaderData.ENV,
avatarUrl,
PASSPORT_URL,
displayName,
Expand All @@ -290,6 +292,7 @@ export default function App() {
<Outlet
context={{
apps,
ENV: loaderData.ENV,
avatarUrl,
PASSPORT_URL,
displayName,
Expand Down
15 changes: 14 additions & 1 deletion apps/console/app/routes/__layout/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,23 @@ import { Text } from '@proofzero/design-system/src/atoms/text/Text'

export default () => {
const navigate = useNavigate()
const { apps } = useOutletContext<OutletContextData>()
const { apps, ENV } = useOutletContext<OutletContextData>()

const GATag = ENV?.INTERNAL_GOOGLE_ANALYTICS_TAG

return (
<>
{GATag && (
<>
{/* <!-- Event snippet for Sign-up conversion page --> */}
<script
async
dangerouslySetInnerHTML={{
__html: `gtag('event', 'conversion', {'send_to': '${GATag}/x8scCNaPzMgYEPT6sYEq'});`,
}}
/>
</>
)}
<div className="mb-11">
<InfoPanelDashboard />
</div>
Expand Down
1 change: 1 addition & 0 deletions apps/console/wrangler.current.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ CONSOLE_URL = "https://console.rollup.id"
POSTHOG_API_KEY = "phc_QGmYrKfXcyIAUBBTX3NBDJjNg2MX24ijFemeUuykzWr"
POSTHOG_PROXY_HOST = "https://analytics.rollup.id"
STRIPE_PUBLISHABLE_KEY = "pk_live_51NFemUKJnr9qdtTaw2gOGoi2rKzXWKtdgO29fuDshACQFGyNIOddSiuW8wUqnKPrW5UMNIA5UesxuYanFTTcQku300oaaqcr8t"
INTERNAL_GOOGLE_ANALYTICS_TAG = "AW-11277204852"

0 comments on commit 1f8d69b

Please sign in to comment.