I'm working on vue.js based SPA, and sometimes I need to manipulate the DOM on specific pages (views).
If I write a js in an extension, that runs only once. I want to run them every time the user goes to another page of my site without overwriteing the whole utag.view function. (In that case I would lose other setups)
Hi @tUser_1842 ,
Yes, extensions can be executed for every call, when you set the scope properly.
If the scope of your extension is in preloader or DOM-ready then the extension will be executed once, because the preloader and dom-ready event will fire when the utag.js library is loaded (Page load).
So to execute the extension for every call (utag.view / utag.link), you can scope the extension to before load rules /after load rules / tag scoped extensions/ after tags.
Please refer the below link,
Order of Operations : https://community.tealiumiq.com/t5/iQ-Tag-Management/Order-of-Operations/ta-p/326
Thank you for your advices.
1. I've changed the scope to "Tag scoped extension" and choose a Tag that seems to run on every page re-render (and only once). So it seems to be working now, thank you so much.
2. I also tried to use "After load rules" and "After tag extensions" scope, and set run always but in this case the extension runs several times indeed. I don't find an option to reduce it to utag.view only.
However 1 is working so I'm gonna go with it.
Thanks for your help again,