Ruby on Rails Monday, July 25, 2016

I thought a hit counter would be simple enough as it's a pretty basic
piece of code to insert to a html page, however when I add statcounter
to my rails app, all the navigation links break. Can anyone advise me as
to the best way to insert something like this to my app? It works but
when I click on a nav link, it just displays the hit counter on a blank
page unless I reload the page or , if I use the invisible hit counter,
it displays an empty page for whatever nav link I click.

application.html.erb

<!--
* Statcounter to monitor visitors, etc to my webapp
* @reference https://statcounter.com
-->

<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=11051099;
var sc_invisible=0;
var sc_security="0e87dbf6";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="shopify
analytics" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="//c.statcounter.com/11051099/0/0e87dbf6/0/"
alt="shopify analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d89cf1c509bd7546321c91d83e798363%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment