How to disable Zaraz default pageview?

We are using Zaraz in our SPA. Now the problem is we cannot enable the option,

Single Page Application support

Because it will trigger immediately after a change in the URL. And this will pass an invalid “Page Title” to the backend tools. Our each page has a dynamic title and it has to be loaded from our API endpoint. Now the available option is to manually trigger zaraz.track('Pageview') inside our SPA after the API call.

Then the major issue is “Pageview” will be triggered twice. First one at the time of zaraz script initialisation and one from our code.

Is there anyway we can prevent the default Pageview at the time initialisation?

Hello @nirmalvce, the workaround of using zaraz.track() for pageview should work. To avoid duplication, when you configure a tool, make sure not to map an action using the automatic Pageview trigger. Some tools, like GA, have it mapped automatically, and you would need to delete the auto-defined action in such cases. If you only map actions using zaraz.track() for pageviews, it should be fine.

1 Like