DEV Community

Discussion on: Add Google Analytics through GTM (Google Tag Manager) on Next.js

Collapse
 
cullylarson profile image
Cully Larson

Is there some significance to the name of the page parameter you're including in the event object? I don't see that parameter documented anywhere and you don't specifically reference it when creating your trigger.

Collapse
 
cullylarson profile image
Cully Larson

I tested without including the page parameter and it works the same. It seems like page isn't necessary.

Collapse
 
oxodesign profile image
Flamur Mavraj

Well the property it self is not required but I think its important to include it. The reason for it is to know what pages the user visits. Without it you are just (unless GTM can figure out this automatically) you only get the counts.

More info regarding the page you can find here:
developers.google.com/analytics/de...

Thread Thread
 
cullylarson profile image
Cully Larson

Oh, nice find. I couldn't find documentation on that parameter; I assumed it wasn't an actual GTM param. Yeah, if you leave it empty GTM figures it out. I was thinking that might be a better option, since it reduces the chance that you set it incorrectly.