Skip to main content

Hi, I would like to set up Amplitude so that when users view a page in my web app, I automatically set user properties (for things like user’s plan name, company name, etc.) before the pageview event is fired. That way, those user properties are passed along with the pageview event.

I’m using Google Tag Manager to fire my Amplitude tags and I’m using the Amplitude Analytics Browser SDK tag template to configure the tags. I am currently using the “Initialize” tag type which comes with an option to enable default tracking (for page views, etc.) This seems to work well in terms of tracking pageviews. However, there is no option to set user properties through this tag type.

The Amplitude tag template DOES have another tag type called “identify” which is specifically intended for setting user properties. I tried adding this tag. However, since the “initialize” tag both initializes Amplitude AND sends pageview events, it means that I’m unable to set the user properties before the first pageview event is sent which will result in some of my events not having the user properties that I need.

Is there a recommended way to configure Google Tag Manager using this Amplitude tag template to ensure that user properties are set before tracking events are fired?

Be the first to reply!

Reply