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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Adobe Launch, Tracking page view With React without refresh the page but change the url, how to get the value and set the condition

buildmeup
Level 2
Level 2

Hello, i want to tracking pageview on page but because the web made from react the page not refreshed but the url changed, similiar like modal but its not.

 

example: origin url www..../page1 when i klik the button the url changed into www.../page2 but the var wont change if i not open it by new tabs. how to get the var within exsiting flow and get the data from www.../page2. with Adobe Launch

Any suggestion/reference, that will be big help.

 

Thanks in advance

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution
Brian_Johnson_
Correct answer by
Community Advisor
Community Advisor

@buildmeup - The simplest approach would be to create a data element that picks up the pathname, then build a rule that executes when that data element changes. For example, assuming you've created a data element named "url_pathname", the rule would execute based on the following event:

evolytics_brian_0-1607613220423.png

One thing to note is you'll need to make sure the s.pageURL property gets updated at same time, or Adobe will associate every page view with the URL that was present when the analytics library first loaded. 

 

 

View solution in original post

9 Replies
Brian_Johnson_
Correct answer by
Community Advisor
Community Advisor

@buildmeup - The simplest approach would be to create a data element that picks up the pathname, then build a rule that executes when that data element changes. For example, assuming you've created a data element named "url_pathname", the rule would execute based on the following event:

evolytics_brian_0-1607613220423.png

One thing to note is you'll need to make sure the s.pageURL property gets updated at same time, or Adobe will associate every page view with the URL that was present when the analytics library first loaded. 

 

 

View solution in original post

buildmeup
Level 2
Level 2
thanks for your answer, i already fix this issue by add clear vars on every rules that i made. thank you bro
yuhuisg
Community Advisor
Community Advisor

Try the "History Change" event.

Reference: https://experienceleague.adobe.com/docs/launch/using/extensions-ref/adobe-extension/core-extension/o...

History Change

Trigger the event if a pushState or hashchange occurs.

jsvasu
Level 3
Level 3
Hi @yuhuisg, I have the same thing implemented at my end. I have webpages which are Single Page Application without refresh. The URL change happens on navigation but not the whole page is refreshed that's why no adobe hit happens until pages are hard refreshed. To solve this I created History Change event in launch and set Send Beacon to s.t() however, Adobe is associating every page view with the page URL that was present when the analytics library first loaded.
Brian_Johnson_
Community Advisor
Community Advisor
@jsvasu - You have to update s.pageURL to the new URL value (document.location.href) for each s.t() call.
Brian_Johnson_
Community Advisor
Community Advisor
@jsvasu - If you're using the Adobe Analytics extension, there's an option to set the "Page URL" under Advanced Options in the Set Variables action type. If you always set that to the value of document.location.href, you should be in good shape.
jantzen_belliston-Adobe
Level 10
Level 10
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?