Zaraz load on prerendered pages

  • Sakamoto

    4 days ago

    Hi, I'm trying to install Zaraz. I tried auto-inject and it works fine. However, it also triggers for prerendered pages.

    I could try triggering it manually with the script tag but it's more difficult to manage. Is there an easy way to get around this?
  • Andreas Møller

    4 days ago

    No I dont think there is, there Are a new set of browser events that lets scripts know when the page was actually shown to a user, and not just when it was rendered, but it requries the scripts to opt in to using them.
  • Sakamoto

    4 days ago

    Thanks for quick reply👍

    Update: I just tried putting the script tag on each page head. It's still triggering on prerender.

    Hmm.. What do you suggest? And how are others dealing with this? Or should I just not use prerender with Zaraz for now.
  • Sakamoto

    2 days ago

    I think I found a solution. I found this package(https://pixel.toddle.site/) that use on load to run the script. So I tried the same approach and it works!

    I also created a package for it. Hope this helps for anyone having the same problem in the future.
    https://zarazload.toddle.site/
    🙌1

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.