- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
08-28-2018 06:49 AM - edited 08-29-2018 04:48 AM
I have implemented tealium in a SPA but I'm running into an issue for quite sometime where the page title in the pageview tag of Google universal analytics is not showing for the current page which is loaded but instead, it's capturing the page title of the previous page.
I have created a page_title udo and mapped it to the title in Google Analytics tag to get the page title. The application has different page title for different pages.
I have also tried to create an extension where I'm passing the document.title value to the page_title udo using the b variable but the fix doesn't seem to work.
Has anyone has encountered this issue before who can help me out on this?
Thanks!!
Solved! Go to Solution.
08-29-2018 09:33 AM
Hi @sujay_das - is the utag.view() function getting called in your SPA with each "page view" (route change)? If so then it might be simple enough to pass in the current page in whatever variable GA has mapped. Or you could add an extension to move in the current page name into the mapped variable so GA can pick it up and stay current.
As usual there's so many ways to handle this, so others may chime in with to share other techniques/tactics! Let us know how it goes...
08-29-2018 12:22 PM
@sujay_das As @mitchellt explained utag.view is the easiest way.
I believe you will passing other variables on the SPA page views using the same utag.view call you can include the page name variable with the current page name and that will solve the issue.
Hope it helps
08-30-2018 04:12 AM
08-30-2018 07:24 AM
Hello @sujay_das
I believe you will be calling utag.view like the below way
Page view 1: utag.view({ variable_one: "Value 1", variable_two: "Value 2", variable_three: "Value 3", }) Page view 2: utag.view({ variable_one: "Value 11", variable_two: "Value 22", variable_three: "Value 33", })
You need to add page_title (or your mapped page title variable) along with it:
Page view 1: utag.view({ variable_one: "Value 1", variable_two: "Value 2", variable_three: "Value 3", page_title: "View 1 Page title" }) Page view 2: utag.view({ variable_one: "Value 11", variable_two: "Value 22", variable_three: "Value 33", page_title: "View 2 Page title" })
Hope this helps!
Copyright All Rights Reserved © 2008-2023