GTM – Datalayer.push on file opening
-
Hey guys!
I am looking to find a solution to execute a datalayer.push script (either inside php or directly in js) when a file is opened.
Example: this page (https://proximite-courtage.fr/actualites/proximite-rendement-durable/) contains a link that directs to (https://www.proximite-courtage.fr/pdf/DICI_PROXIMIT%C3%89%20RENDEMENT%20DURABLE_FR0014007BD1.pdf).
I was under the impression that there is no hook or filter for that, but if there is, please I will be happy to be wrong.
If not, how the hell am I supposed to implement that?
I could just create a class and call the datalayer onClick, but it means I need to attribute the class to each file tag, which I would like to avoid because it’s my client that creates the content, and i’d rather not tell him to attribute this class to each file that needs tracking.
Is there a better way to do this?
Thanks!
PS: I have been a dev for 15 years, but pretty new to web and PHP/Wordpress, so I might be pretty ignorant with some stuff.
The page I need help with: [log in to see the link]
- The topic ‘GTM – Datalayer.push on file opening’ is closed to new replies.