Any way to track browser pop-ups as events using Adobe Launch? We have multiple popup in same page like shown below. I need to differentiate using text displayed in form. This is not allowing me to inspect element.
Solved! Go to Solution.
Views
Replies
Total Likes
Not sure... you might be able to detect something without a custom event... (basically you can try to detect based on standard web events)... then trying to identify what that popup is would be the next challenge....
Views
Replies
Total Likes
For this, you may need your developers to create a custom JS event (where they can also provide details in the event.details parameters) that you can listen for an create tracking around.
https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events
Example:
document.dispatchEvent(new CustomEvent("popup", {
detail: { name: "payment term" }
}));
In Launch, you can create a custom code trigger for the "popup" event:
document.addEventListener("popup", function(event) {
window.popupDetails = event.detail;
trigger();
});
The "trigger();" part is what allows the custom trigger to move onto the actions of your Rule, you will also noticed that I created a window level object to hold the event detail content (so that it can be read within the actions) - while you should be able to read from event.detail directly, depending on timing of your actions, the info could self-destruct before you get to it (hence adding it to a temp window object ensures that this is fully available to you).
Now, in your actions, you can pull from window.popupDetails to get all the passed values (in JSON format), or you can pull specific fields with window.popupDetails.name and build out your tracking (you can still use Data Elements pulling from window.popupDetails.name, and use as you would any other Data Element.
If you may have multiple popups on the same page, or your site is an SPA, it would be safe to add one rule to your action to clear window.popupDetails once you have extracted everything from it in your tracking:
// Clear the temp object
window.popupDetails = "";
Views
Replies
Total Likes
Thanks so much but any solution without developer ?
Views
Replies
Total Likes
Not sure... you might be able to detect something without a custom event... (basically you can try to detect based on standard web events)... then trying to identify what that popup is would be the next challenge....
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies