Accepted Solutions (1)

Accepted Solutions (1)




Hey Srini,

I know this is old, but I wanted to come back and answer this from an answer I gave a little bit ago.  Yes, you can track SPA's.  Here is what I posted before:

I don't have any documentation or best practices, but we have done a little bit of tracking with angular and this has come in handy for "page views":

In other words, if you want to hook into a view change event with angular, you could do something like this:

$('appElement').scope().$root.$on('$locationChangeSuccess', function () { console.log(window.location.href); // can use this for page name //s.t(); or; or fire a "direct rule" in DTM });

There are other things you can do from there of course like listening/watching:$rootScope.Scope#$watch

And you can use DTM's selectors to do other event based rules as well.

That is the little advice I can give.  🙂

Answers (0)