I have a .NET framework application. There are many pages in this web application.
for example:
=======================================
About us |
To-Do List |
user List | catch me if you can
dessert shop | o~(‾▿‾)~o
cloth shop |
galleries |
=======================================
But it's not SPA, if I click "To-Do List", it will load an iframe in the right. And if I click "user List", it will load another iframe.
So when I embed Google Tag Manager code on the home page, It will only track my menu, it won't track other iframes' activities. Should I create as many google tag manager account as my iframe has?
You could create more GTM instances in iframes, but it will make implementation much more complex.
Generally, in cases like these we just send window messages from iframes to the parent window, where they are translated to datalayer events by a listener (that can be deployed by GTM on pageload), for which GTM would listen and fire.
Don't forget to include click context in window messages. And then the context will have to be translated to datalayer variables pushed within the same object as the click event.
If you can, try to not deploy extra code like listeners through GTM if you can do that through front-end codebase. GTM has max size, so the less code it contains, the better.