Search code examples
javascriptgoogle-tag-managerpageviews

Pageview trigger not firing in Google Tag Manager


I'm trying to fire a pageview trigger whenever the manage staff page of my website is viewed. I tried to do it using the PageView trigger and using Page URL equals https://workex.jobs/manage-staff. The manage staff page can be opened from the home screen by clicking on Manager Staff button on the header. Link to the home page - https://workex.jobs/ Link to the page I'm trying to monitor - https://workex.jobs/manage-staff The pageview trigger is not fired when I click on manage staff button on the header which opens the page I'm tracking (https://workex.jobs/manage-staff). But, the trigger is only fired when I refresh the manage staff page. I want to know why the pageview trigger does not fire when I click on the button that opens the page whose URL I'm tracking? [enter image description here][1]


Solution

  • The pageview trigger doesn't work on navigations because your site is an SPA. A single page application. It implies that there are no real pageloads on navigations. On a hard refresh or when you navigate to that page directly and not as a result of site navigation, a pageview is issued.

    You just want to add a history change trigger to your existing pageview trigger. This one: enter image description here

    And apply your additional trigger page filters or it will fire on every navigation.