question: I have an instance where once I submit the order and complete the purchase and then go back to buy another product in the same session. The previous product values persist in the order checkout. i.e in the s.products
I am clearing the variables after the checkout. Not sure what could be the bug. If I open a new session then that issue does not occur. It occurs if I am using the same browser window.
Below are the screenshots of my current checkout rule (edited)
Solved! Go to Solution.
Views
Replies
Total Likes
In your custom code, you're traversing through the ACDL to build your s.products string for the "scCheckout" event. Based on that and your problem statement, I suspect that your website is a Single Page Application (SPA) that does not have any so-called "physical" web pages.
If that is correct, then your ACDL basically keeps getting pushed with new events with every user interaction and "virtual" web page. It never gets reset to an empty array. So when you traverse your ACDL in your code, all of the old data still exist in ACDL, including the "scCheckout" one, which then causes your problem.
If that is correct, then you should use adobeDataLayer.getState() to get the computed data layer object, instead of traversing the adobeDataLayer array. Reference: https://github.com/adobe/adobe-client-data-layer/wiki#getstate
I suggest re-doing your Launch setup:
As you may have noticed, my suggestion involves a lot of re-work in your Launch setup, including replacing custom code like "s.t()" with a Send Beacon action from the AA extension. So this isn't a trivial suggestion to implement.
Which values are persisting? Is it the Product identifier? Or some of the eVars... This could be a hard thing to sort out... we can only see a subset of the logic happening on your site....
Is it possible you have your eVar expiry set to maintain values for some period... clearing the value of a "visit" level eVar just means that you aren't explicitly sending a value... since no value is being sent that overrides the previous value, the eVar configuration will continue to populate the resulting data in your suite with that value until the visit is over....
This is how tracking a campaign generally functions... someone comes to my site with a ?cid=x (I put "x" into an eVar that will expire at the end of the Visit). If the user clicks on 4 more pages, there is no cid=x in the URL, but my eVar will track the value "x" on every page of that visit.
Your issue would benefit from a deep dive testing session; you may have to dig into all the actions and results to try and find where the problem is occuring.
Good Luck... issues like this are never easy to deal with.
Views
Replies
Total Likes
In your custom code, you're traversing through the ACDL to build your s.products string for the "scCheckout" event. Based on that and your problem statement, I suspect that your website is a Single Page Application (SPA) that does not have any so-called "physical" web pages.
If that is correct, then your ACDL basically keeps getting pushed with new events with every user interaction and "virtual" web page. It never gets reset to an empty array. So when you traverse your ACDL in your code, all of the old data still exist in ACDL, including the "scCheckout" one, which then causes your problem.
If that is correct, then you should use adobeDataLayer.getState() to get the computed data layer object, instead of traversing the adobeDataLayer array. Reference: https://github.com/adobe/adobe-client-data-layer/wiki#getstate
I suggest re-doing your Launch setup:
As you may have noticed, my suggestion involves a lot of re-work in your Launch setup, including replacing custom code like "s.t()" with a Send Beacon action from the AA extension. So this isn't a trivial suggestion to implement.
Based on your suggestion, I am going to redo the launch setup as it is currently traversing the entire DL and it is creating problems in debugging and reports. Thanks a lot for the repository Link. Devs had implemented long time back and need to showcase that to them and pull those data in my rules using getState
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies