Nov 2, 2021 7:47 PM
I have a Next.js app where I included the tracking script in order to set up a lead tracking popup form. In my targeting configuration, under Website URL > Hide Pop-up, I specified URLs that contain "/admin" and "/application". I expect to not see the popup show on those pages but I still do.
I was able to pin down the specific issue but don't know what the solution is. The tracking script is only loading on the initial visit. Next.js does not reload scripts when navigating around the site. I've already tried tracking page views manually following the tracking code API guide. The page views are tracking correctly but the popup lead form still shows.
It seems that the lead form popup portion of the script is only initializing on the initial page visit and not on every page as it would on a typical site.
Nov 5, 2021 8:53 AM - edited Nov 5, 2021 8:55 AM
The problem is probably being caused because of the fact that you use a PWA created by Next.js. The tracking script will not reload because of the fact that you do not reload the page when changing pages, as it is probably a Single Page Application right?
So somehow, you need to simulate the page changes and let the tracking script know.
I found this post, and they mention the Set Page Path function, which seems different from the Track Page View docs. Does this help?
Nov 3, 2021 2:57 PM
Nov 4, 2021 12:32 PM - edited Nov 4, 2021 12:33 PM
@dennisedson Yes. As far as I can tell, those docs are pretty much identical to the ones I linked in my original post.
Nov 4, 2021 2:47 PM