diff --git a/src/third-parties/google-analytics/data.json b/src/third-parties/google-analytics/data.json index 211f447..e032f16 100644 --- a/src/third-parties/google-analytics/data.json +++ b/src/third-parties/google-analytics/data.json @@ -15,7 +15,7 @@ "key": "gtag" }, { - "code": "window[{{l}}]=window[{{l}}]||[];window['gtag-{{l}}']=function (){window[{{l}}].push(arguments);};window['gtag-{{l}}']('js',new Date());window['gtag-{{l}}']('config','{{id}}')", + "code": "window['{{l}}']=window['{{l}}']||[];window['gtag-{{l}}']=function (){window['{{l}}'].push(arguments);};window['gtag-{{l}}']('js',new Date());window['gtag-{{l}}']('config','{{id}}')", "params": ["id"], "optionalParams": { "l": "dataLayer" diff --git a/src/utils/index.ts b/src/utils/index.ts index 2834526..44ef357 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -56,9 +56,7 @@ export function formatCode( ) { return code.replace(/{{(.*?)}}/g, (match) => { const name = match.split(/{{|}}/).filter(Boolean)[0]; - return JSON.stringify( - args?.[name] !== undefined ? args?.[name] : optionalParams?.[name], - ); + return args?.[name] !== undefined ? args?.[name] : optionalParams?.[name]; }); }