Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Page Name is not accurately capturing the correct page

Avatar

Avatar
Validate 1
Level 1
engineer_kt
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
engineer_kt
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
engineer_kt
Level 1

21-01-2020

I'm finding that my PageName variable is not reading the correct value. The app is a SPA Vue app, in Launch, the PageName is set as "%Path%%Hash%" and the Page Url is set as "%URL%".

What is happening is for example I am on my /pay/verify page, when I click on a link with an analytics call, the page name is supposed to register as "/pay/verify" however, it is reading as the next page that I arrive at, say "/pay/method" instead. In the click handler for the link, I have:
 

chooseVerificationOptions() { this.router.push({ name: ROUTES.METHOD })

What is the cause of this and what can I do? I can capture the current page name with window.location.pathname in my code. Can I pass this to a variable and send this to PageName directly? Any help is greatly appreciated. Thanks.

Analytics launch

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 50
Level 6
pabloc82923542
Level 6

Likes

76 likes

Total Posts

358 posts

Correct Reply

81 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Level 6
pabloc82923542
Level 6

Likes

76 likes

Total Posts

358 posts

Correct Reply

81 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
pabloc82923542
Level 6

21-01-2020

For SPA I would use a direct call rule to indicate page navigation change(virtual pageview).

 

Then in data layer populate the pagename variable page to page. This way a beacon is set per page movement and not one step behind like you have now. It also allows for web browser reloads as well as back and forth arrows. The beacon method also allows you to enable button and link tracking to align with source page. SO when a link is clicked it is associated with correct originating page.(you don't need to make a seperate link click rule if using Activity Map)

 

Also another advantage of this methodology if the hash structure were ever changes the direct call rules would not be changed.

 

 

Answers (0)