Skip to content

Commit

Permalink
Directly Inject LDFR Script
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusSorealheis committed Nov 11, 2024
1 parent 7e766d1 commit 17dbedb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions web/platform/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ export default defineConfig({
}),
starlight(starlightConfig),
sitemap(),
partytown({
config: {
forward: ["dataLayer.push"],
},
}),
partytown(),
],
markdown: {
rehypePlugins: [
Expand Down
8 changes: 7 additions & 1 deletion web/platform/src/thirdParty/GoogleTagManager.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ const props = Astro.props as Props
const measurementId = props.measurementId
---
<script
type='text/partytown'
type="text/partytown"
src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}>
</script>
<script
type="text/partytown">
partytown = {
forward: ['dataLayer.push']
};
</script>
<script type="text/partytown">
window.dataLayer = window.dataLayer || [];
window.gtag = function gtag(){dataLayer.push(arguments);}
Expand Down

0 comments on commit 17dbedb

Please sign in to comment.