GreenInfo-Network / nyc-crash-mapper-chart-view

Chart view for NYC Crash Mapper that allows for viewing Trends, Comparing, and Ranking of various NYC geographies
http://vis.crashmapper.org
MIT License
2 stars 1 forks source link

Add tracking code #88

Closed danrademacher closed 6 years ago

danrademacher commented 6 years ago

She uses Clicky.com, which I can't recall ever using, but she also provides the code, so easy:

She gave me two options but also says "I do not want a counter to appear on the website," I think that last bit must refer to the <noscript> elements in the code snip[pets below.

So I hope we can just leave those out. I wonder if clicky.com might check for their presence, so just in case their removal causes issues I thought I would leave in the code snippets here for reference.

<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init(101099262); }catch(e){}</script>

<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/101099262ns.gif" /></p></noscript>

OR the asynchronous code that is less taxing on the website performance.

<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(101099262);
(function() {
  var s = document.createElement('script');
  s.type = 'text/javascript';
  s.async = true;
  s.src = '//static.getclicky.com/js';
  ( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>

<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/101099262ns.gif" /></p></noscript>
danrademacher commented 6 years ago

Deployed and reported to client. once she confirms analytics are coming thru, we can close this