Hi,
Is there a way to modify the tracking script for it to work with Adobe Analytics insted of Google Analytics? Thank you!
Hi there, @user4477 and welcome aboard ![]()
Interesting question!
I guess it’s possible. Could you please send me a link to the page where your Popup widget is installed or just specify its ID? We’ll gladly look into this for you ![]()
Hi Max, thank you for your reply!
The widget ID is 32f9a650-0b14-4dec-be02-c8b21a1a17bb and we’ve installed it here: Ausflugsziele - Wetter-Alarm
Thanks! You’d like to track clicks on all widget elements (popup itself, button, close button), right?
Yes, altough it would be important to be able to differentiate between the elements. So that we know if the user closes the popup or clicks out CTA ![]()
Got it, thanks!
Your request is with our devs now. I’ll update you once I have their response ![]()
Hi there, @user4477 ![]()
We’ve added this script to the Custom JS field on the Settings tab of your widget’s settings that should pull the click stats to your Adobe account:
function addAdobeAnalytics() {
waitForElement('[class*="PopupCloseControl__PopupCloseControlContainer-sc"]').then(closeBtn => {
if (!closeBtn.dataset.analyticsAttached) {
closeBtn.addEventListener('click', () => {
s.tl(this, 'o', 'Popup Close Button Click');
});
closeBtn.dataset.analyticsAttached = 'true';
}
const banner = document.querySelector('[class*="Banner__Container-sc"]');
if (banner && !banner.dataset.analyticsAttached) {
banner.addEventListener('click', () => {
s.tl(this, 'o', 'Popup Click');
});
banner.dataset.analyticsAttached = 'true';
}
const baseButton = document.querySelector('[class*="ButtonBase__ButtonContainer-sc"]');
if (baseButton && !baseButton.dataset.analyticsAttached) {
baseButton.addEventListener('click', () => {
s.tl(this, 'o', 'Popup Button Click');
});
baseButton.dataset.analyticsAttached = 'true';
}
addAdobeAnalytics();
});
}
addAdobeAnalytics();
Please check it out and let me know how it goes ![]()