zadigetvoltaire / nuxt-gtm

Nuxt 3 module for Google Tag Manager
https://www.npmjs.com/package/@zadigetvoltaire/nuxt-gtm
MIT License
59 stars 3 forks source link

Page View only sent on initial load / full refresh #23

Open signor-pedro opened 6 months ago

signor-pedro commented 6 months ago

Hi, I have an interesting situation here.

I have configured this module with

{
gtm: {
    id: 'my-id',
    defer: false,
    compatibility: false,
    loadScript: true,
    debug: true,
    enabled: true,
    enableRouterSync: true, // I want it to sync
    trackOnNextTick: true,
  },
}

Now, whenever I hit a hard refresh, I can see in the console that the page view was tracked:

Snímka obrazovky 2024-01-12 o 12 01 41

...and in Network, I can also see the follow-up "beacon" POST request:

epik

Problem

When I start navigating on the client-side (clicking a <NuxtLink>), I can see the console outputting the track views:

Snímka obrazovky 2024-01-12 o 12 04 39

However, there is no follow-up beacon and the data never arrives to Google.

Has anyone experienced this / can anyone confirm?

Is there a workaround?

Thank you.

iD30 commented 1 month ago

We had the same issue, try turning on 'Page changes based on browser history events' within the 'Enhanced Measurement - Page Views' section within Analytics. This worked for us.