Get Number of Times a Page is Visited

Community Alums
Not applicable

We're looking to see how many times our CMS home page has been visited since our ServiceNow release. Is there a way to get this information in a report?

1 ACCEPTED SOLUTION

jcote
Giga Expert

Hi Aryanos,



You could implement Google Analytics into your site here: How Do I Integrate Google Analytics into My Instance?


View solution in original post

4 REPLIES 4

jcote
Giga Expert

Hi Aryanos,



You could implement Google Analytics into your site here: How Do I Integrate Google Analytics into My Instance?


Community Alums
Not applicable

Hi Jamison,



Thanks for the link. I tried creating the UI script and it threw some errors in the validation. Did you have any issues with the script? Seems to be the same as the screenshot that Will showed in that thread. I've X'd out the account number.



  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){


  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),


  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)


  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');



  ga('create', 'UA-XXXXXXX-1', 'auto');


  ga('send', 'pageview');


Aryanos,



Did you make a Google Analytics account (free) and push your tracking ID into the script (not just cut and past the one from the post, which would contain a Google Analytics tracking ID for another user account)?



You can go into your own Google Analytics account, go to the Tracking Info. section and find the Tracking script to create the UI Script. This is what I did and it works.



When I validate the script, I do receive 3 warnings and 1 error from ServiceNow, however I am able to save the script and it runs successfully.



WARNING at line 1: ['GoogleAnalyticsObject'] is better written in dot notation.


WARNING at line 2: Missing semicolon.


WARNING at line 2: Missing semicolon.


ERROR at line 2: Expected an identifier and instead saw ','.




You have implemented the script in the correct way if you use your own unique tracking ID.


Community Alums
Not applicable

Hi Jamison,



Yep, it's the script from the Google Analytics site with my tracking ID. Ok, I got the same warnings and errors and didn't know if it was normal or not.