Hello,
Using Launch to Pull data from SPA can be fun at times.!
We've tried direct call rules, old DTM method and new Launch style all work fine.
We've tried data element change, works fine.
But which do you prefer? - I'd love to get a view from the community on the way forward for analytics tracking when working with react or angular.
Solved! Go to Solution.
Views
Replies
Total Likes
My personal preference is Direct call rules. I have found they are the most successful and once applied allows me and developers great flexibility and minimal triaging for breakage. There are 2 things though that need to be mentioned.
1 To optimally tag you need a good datalayer, if you don`t have one or try and set is dynamically via a bunch of element rules you will spend alot of extra time troubleshooting.
2 Most SPA once tagged forget to account for browser Back and forth buttons, so make sure devs accommodate this.
GLTU
I personally prefer Custom Events, the modern version of Direct Call. Both work in a similar manner, but Custom Events are a W3C standard that all modern browsers support natively.
Update:
Actually, I think I prefer an event-driven data layer, e.g. ACDL. SPAs themselves are generally driven by events, so it makes sense to tap into that for tracking too.
My personal preference is Direct call rules. I have found they are the most successful and once applied allows me and developers great flexibility and minimal triaging for breakage. There are 2 things though that need to be mentioned.
1 To optimally tag you need a good datalayer, if you don`t have one or try and set is dynamically via a bunch of element rules you will spend alot of extra time troubleshooting.
2 Most SPA once tagged forget to account for browser Back and forth buttons, so make sure devs accommodate this.
GLTU
Hi,
I couldn't agree more with you on he dataLayer comment. I'm guessing you like me have been through the pain of objects not updating in time for the call! :). I remember one install having to to have a direct call which fired another direct call but delayed for 200-300 ms... Fortunately we worked with dev to get that sorted.
But interesting we have two different views on SPA tracking.
Views
Replies
Total Likes
Adding my 2 cents worth... I also prefer the custom event method, but this is also because our site has a lot of extra dependencies that we need to ensure are completed before tracking occurs, so using custom events allows us more control on when the tracking fires (after all the bits and pieces have finished so that they can be collected - of course we also added logic that if those pieces fail after an appropriate timeout to trigger the custom event anyway so that we don't lose tracking completely).
Views
Replies
Total Likes
Views
Like
Replies
Views
Like
Replies
Views
Likes
Replies