Websphere
Websphere

Reputation: 603

How to push to google analytics page title on SPA

good evening everyone,

I'm trying to use GTM for analytics on my SPA website, I manage to get analytics working thanks to this post by @András Szepesházi: Google Tag Manager and Single Page apps, but i just realized that the page title isn't being pushed to analytics. I tried to created new variables but didn't manage to make it work. Any ideas how to do that?

Thanks

Upvotes: 0

Views: 2156

Answers (1)

Michele Pisani
Michele Pisani

Reputation: 14179

Based on the example of your link, after creating the variables and managing the push on page change, you need to setup the Universal Analytics with 2 'Fields to Set':

  • 'title' to {{DL-page title}}
  • 'page' to {{DL - page url}}

In Google Tag Manager Analytics Tag you will have a situation like the following:

enter image description here

So you send both the page and the title with the same Analytics hit.

Upvotes: 2

Related Questions