M
M
maggg2015-05-10 11:39:43
JavaScript
maggg, 2015-05-10 11:39:43

How to correctly insert a Liveinternet counter into an application on Meteor.js?

The question most likely scales to the entire application area, where the layout is assembled from templates and data transmitted by the server on the client side. And other analytics systems.
The good old approach when we made sites that give the user the code assembled on the server side was to simply add the counter code to the page template.

<!--LiveInternet counter--><script type="text/javascript"><!--
document.write("<a href='//www.liveinternet.ru/click' "+
"target=_blank><img src='//counter.yadro.ru/hit?t26.6;r"+
escape(document.referrer)+((typeof(screen)=="undefined")?"":
";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
";"+Math.random()+
"' alt='' title='LiveInternet: number of visitors for today is"+
" shown' "+
"border='0' width='88' height='15'><\/a>")
//--></script><!--/LiveInternet-->

In the case of Meteor.js, this approach will not work. You can't just insert JavaScript into a template. You can, of course, bind the execution of the counter code to template events. Or execute it after loading any route.
But maybe there is some kind of silver bullet for such a case?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question