Google Analytics

4 views
Skip to first unread message

Claes Matthias

unread,
Jun 13, 2017, 10:14:45 AM6/13/17
to genome...@soe.ucsc.edu, Audrey Michel

Hi,


We are trying to figure out how many user visit our website.

We have an google analytics key, we declare in the cgi-bin/hg.conf -  file.

We were just wondering how we could check if it works:

- Do we need to recompile everything first?

- And in what format do we need to put it in, does it need quotation marks? We have tried something like this:

   analyticsKey=UA-XXXXXXXX-X


Any suggestions will be helpful.

Thanks in advance


Kind regards,

Matthias Claes

Hiram Clawson

unread,
Jun 13, 2017, 10:28:26 AM6/13/17
to Claes Matthias, genome...@soe.ucsc.edu, Audrey Michel
Good Morning Claes:

To verify your key is being used, you can examine
the output of hgTracks. In your WEB browser,
use the 'view source' to see the text. At the
end you should see the google javascript code:

(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-X', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');

You should see your key in that code. It may take a day or two
for the google analytics system to process your data and produce
a display.

You can also examine your Apache logs to find IP addresses and thus
a rough measure of 'users'. Use one of the Apache log analyzers
to produce a report from your logs. For example:
http://www.webalizer.org/
https://awstats.sourceforge.io/

--Hiram
Reply all
Reply to author
Forward
0 new messages