Analytics
5.2K members online now
5.2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Google Analytics with Angular website?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Does Google Analytics work OK with single page app frameworks like Angular?

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by Bronwyn V (Top Contributor)
September

Re: Google Analytics with Angular website?

Top Contributor
# 3
Top Contributor
Hi Patrick B,

GA does work on an Angular site, but with a huge caveat! You need to be able to properly trigger your virtual page views and other things that may normally depend on the traditional page views, like ecommerce (think about how you would do impressions!). With Google Tag Manager, this may be slightly easier to do and you would need to push events to the dataLayer, again for almost everything like new (virtual) pageviews, click events, form fills, ecommerce, etc. Use this in combination with the history listener and you should be able to track pretty much everything.

Hope this helps., but if you have any other questions then please don't hesitate to post back here.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

View solution in original post

Re: Google Analytics with Angular website?

A T
Participant ✭ ✭ ✭
# 2
A T
Participant ✭ ✭ ✭
Marked as Best Answer.
Solution
Accepted by Bronwyn V (Top Contributor)
September

Re: Google Analytics with Angular website?

Top Contributor
# 3
Top Contributor
Hi Patrick B,

GA does work on an Angular site, but with a huge caveat! You need to be able to properly trigger your virtual page views and other things that may normally depend on the traditional page views, like ecommerce (think about how you would do impressions!). With Google Tag Manager, this may be slightly easier to do and you would need to push events to the dataLayer, again for almost everything like new (virtual) pageviews, click events, form fills, ecommerce, etc. Use this in combination with the history listener and you should be able to track pretty much everything.

Hope this helps., but if you have any other questions then please don't hesitate to post back here.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Google Analytics with Angular website?

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Nicky, with GTM are you able to use tags for event tracking the same way as you do on a non-angular site? I've not been sure what is meant by declarative event tracking and shudder at the thought of having to manually tag everything like the old days!

Google Analytics with Angular website?

Top Contributor
# 5
Top Contributor

Hi, @Charlotte T,

 

GTM should work the same way on Angular sites as non-Angular sites. From my limited exp with Angular, you should still be able to tag and markup your HTML and CSS in a such a way that makes it easy to trigger events on clicks such that you don't need to manually tag each link or element. 

 

Hope this helps.

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn