Skip to content

Commit

Permalink
docs(nx-dev): add rb2b script to _app.tsx
Browse files Browse the repository at this point in the history
This commit integrates the rb2b tracking script into the application by injecting it into the page with the `afterInteractive` strategy.
  • Loading branch information
bcabanes committed Dec 2, 2024
1 parent 6a46030 commit 1eeb213
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nx-dev/nx-dev/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ export default function CustomApp({
`,
}}
/>
<Script
id="rb2b-script-loader"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
!function () {var reb2b = window.reb2b = window.reb2b || [];if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);args.unshift(method);reb2b.push(args);return reb2b;};};for (var i = 0; i < reb2b.methods.length; i++) {var key = reb2b.methods[i];reb2b[key] = reb2b.factory(key);}reb2b.load = function (key) {var script = document.createElement("script");script.type = "text/javascript";script.async = true;script.src = "https://s3-us-west-2.amazonaws.com/b2bjsstore/b/" + key + "/0NW1GH7YJ4O4.js.gz";var first = document.getElementsByTagName("script")[0];first.parentNode.insertBefore(script, first);};reb2b.SNIPPET_VERSION = "1.0.1";reb2b.load("0NW1GH7YJ4O4");}();
`,
}}
/>
</>
);
}

0 comments on commit 1eeb213

Please sign in to comment.