2

I have a AngularJS v1.0.7 web application. I have just integrate Google Analytics by adding the javascript tracking code. However, I don´t see anything interesting in Google Analytics reports and so on. I know, right now there is people visiting my site and I don´t see anything in GA.

I have just copied and pasted the js script tracking code provided by Google at the end of my head section in the main page. As, it is a template, I assume is inserted in all pages, so I don´t need to copy the script to every page, right? Am I doing something wrong? Is there any way to check GA is correctly installed and gathering data?

Moreover, I have inserted the js tracking code provided by Google, but I have seen there is Angulartics library. Should I use this directive instead of the Google script? Is there any additional benefits?

Rober
  • 5,868
  • 17
  • 58
  • 110
  • 1
    How long has the tracking code been live on your site? It normally takes a day or two for you to see activity. – Luc Feb 12 '15 at 19:11
  • Could be problem with the dynamic insertion of script tag containing DOM. May be the browser is not executing that script part. Try inserting a custom javascript code in head and check whether it is running or not. Take a look here [1] http://stackoverflow.com/questions/610995/cant-append-script-element and here [2] http://stackoverflow.com/questions/3857874/how-to-dynamically-insert-a-script-tag-via-jquery-after-page-load – Sony Mathew Feb 12 '15 at 19:18

1 Answers1

0

The pages in an angular app don't actually reload like traditional web apps and because of that the GA code most likely isn't firing. I recommend using Angulartics instead of the normal GA code.

I can't help ya on the directive question because I don't really know Angular but I work in analytics and have had that problem with Angular apps.

NicoM
  • 629
  • 2
  • 6
  • 22
  • 1
    Well I finally used Angularytics (not same as Angulartics) because the first one wasn´t compatible with my AngularJS 1.0.7 version. – Rober Feb 18 '15 at 07:27