Julian
November 1, 2021, 2:28pm
1
Hi there,
I’d like to create a trigger which looks at the “click text” of a button. So e.g. if the button text is “Next”, and this button is being clicked, I’d like the trigger to fire.
GTM comes with this by default. How can I achieve that in Piwik Pro?
Thank you and best regards
Julian
Michael
November 2, 2021, 10:12am
2
Hi @Julian ,
Currently we supply this as Custom JS variable, just add this code as a new JS function variable in your Tag Manager:
function() {
e = window.event;
if (e && e.target && e.target.tagName !== "BODY"){
return e.target.textContent || e.target.innerText;
};
}
I hope this will be helpful. Feel free to reach out in case you have any other questions.
1 Like
Julian
November 2, 2021, 11:12am
3
Thank you @Michael ! This works perfectly.
1 Like
WWNL
April 28, 2022, 3:04pm
4
This works great for now, but I do wish all the standard variables in GTM would also be available in Piwik PRO. Would make live a lot easier!