Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ export interface Props {
* @description run GTM directly on the main thread, without Partytown. This is useful for debugging purposes. Default: false
*/
dangerouslyRunOnMainThread?: boolean;
/**
* @description turns async attribute on script true or false. Default: false
*/
isAsyncAttributeActiveOnScript?: boolean;
}

export default function Analtyics(
{ trackingIds, src, dangerouslyRunOnMainThread, googleAnalyticsIds }: Props,
{ trackingIds, src, dangerouslyRunOnMainThread, googleAnalyticsIds, isAsyncAttributeActiveOnScript }: Props,
) {
const isDeploy = !!context.isDeploy;
return (
Expand Down Expand Up @@ -67,6 +71,7 @@ export default function Analtyics(
<script
type="module"
id="analytics-script"
async={isAsyncAttributeActiveOnScript}
dangerouslySetInnerHTML={{
__html:
`window.DECO_SITES_STD = { sendAnalyticsEvent: ${sendAnalyticsEvent.toString()} }`,
Expand Down