GTM on page transitions #929
-
What did you expect? 🧐Hello! I've worked on several websites using Swup, and recently I've developed two sites in the same way. Here's how Swup is set up on both:
On these 2 pages, I use Boostify to load GTM. This is what I do in both:
However, on one of these two pages, I went a step further and added a feature for when the page changes because I suspected the initial setup wasn't tracking page changes in GTM:
What actually happened? 😵💫The surprise came when I talked to my Digital team, and they told me that both setups were working fine and tracking page changes. My question is: what's the correct way to handle this? Thanks in advance. Swup and plugin versions 📝"swup": "^4.5.1", What browsers are you seeing the problem on? 🧭No response Relevant log output 🤓No response URL to minimal reproduction 🔗https://renewalclaimsolutions.com/ Checked all these? 📚
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
GTM can be configured to listen to history changes, in which case it would also track subsequent page views without a need for custom hooks. If the history change trigger is disabled, the hook should however be required unless you only want to track the initial page view on load. So it depends on your GTM config. |
Beta Was this translation helpful? Give feedback.
GTM can be configured to listen to history changes, in which case it would also track subsequent page views without a need for custom hooks. If the history change trigger is disabled, the hook should however be required unless you only want to track the initial page view on load. So it depends on your GTM config.