diff --git a/docs/play.mdx b/docs/play.mdx index a1967060..cef5bb01 100644 --- a/docs/play.mdx +++ b/docs/play.mdx @@ -1,5 +1,5 @@ --- -title: Svix Play - webhook debugger +title: Svix Play - Webhooks Debugger --- You can use the [Svix Play webhook playground and debugger](https://www.svix.com/play/) to easily inspect, test and debug operational webhooks. @@ -175,4 +175,3 @@ curl -X DELETE https://api.play.svix.com/api/v1/history/e_94XdF-OwN3EaTKty4izJDW ``` This will permanently remove all events associated with that token. - diff --git a/docusaurus.config.js b/docusaurus.config.js index 37e34241..3e385694 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -137,6 +137,11 @@ module.exports = { async: true, defer: true, }, + { + src: "/js/apollo.js", + async: true, + defer: true, + }, { src: "/js/commonroom.js", async: true, diff --git a/src/client-modules/apollo-pixel.js b/src/client-modules/apollo-pixel.js index 043c6844..0ddbc5d7 100644 --- a/src/client-modules/apollo-pixel.js +++ b/src/client-modules/apollo-pixel.js @@ -1,23 +1,13 @@ const APOLLO_APP_ID = '66317583955bbd0438bc78c3'; -function loadApolloScript() { - const nocache = Math.random().toString(36).substring(7); - const script = document.createElement('script'); - script.src = `https://assets.apollo.io/micro/website-tracker/tracker.iife.js?nocache=${nocache}`; - script.async = true; - script.defer = true; - script.onload = function () { +function trackApolloPage() { + if (window.trackingFunctions) { window.trackingFunctions.onLoad({ appId: APOLLO_APP_ID }); - }; - document.head.appendChild(script); + } } -loadApolloScript(); - export function onRouteDidUpdate({ location, previousLocation }) { if (location.pathname !== previousLocation?.pathname) { - if (window.trackingFunctions) { - window.trackingFunctions.onLoad({ appId: APOLLO_APP_ID }); - } + trackApolloPage(); } } diff --git a/static/js/apollo.js b/static/js/apollo.js new file mode 100644 index 00000000..a5f89262 --- /dev/null +++ b/static/js/apollo.js @@ -0,0 +1,11 @@ +(function () { + var APOLLO_APP_ID = '66317583955bbd0438bc78c3'; + + var script = document.createElement('script'); + script.id = 'apollo-tracker-script'; + script.src = 'https://assets.apollo.io/micro/website-tracker/tracker.iife.js'; + script.async = true; + script.defer = true; + + document.head.appendChild(script); +})();