diff --git a/packages/static-site/src/pages/DataLayerGuide.tsx b/packages/static-site/src/pages/DataLayerGuide.tsx index 427d3cfae9..d5ddd8b223 100644 --- a/packages/static-site/src/pages/DataLayerGuide.tsx +++ b/packages/static-site/src/pages/DataLayerGuide.tsx @@ -1,6 +1,15 @@ import { FC } from "react"; import { Link } from "react-router-dom"; import { PagePaths } from "~/routes/config"; +import { default as watchDataLayer } from "~/utils/watchDataLayerBookmarklet?raw"; + +export const bookmarklet = `javascript:(${watchDataLayer.toString() + // remove line breaks + .replace(/\n/g,"") + // remove comments + .replace(/\/\*.*?\*\//g, "") + // replace multiple spaces with a single space + .replace(/\s+/g, " ")})();` const gtmCodes = { universal: "GTM-KDWN8Z", @@ -16,13 +25,13 @@ const GtmCodeExample: FC<{ gtmCode: string }> = ({ gtmCode }) => { */ const headScript = ` - - - `; + + + `; const bodyScript = `