Home > Uncategorized > How to add google analytics in openautoclassifieds

How to add google analytics in openautoclassifieds

Question

I want to add Google Analytics code in the openautoclassifieds, but when I do this I get the error

Fatal error: Smarty error: [in ../Default/footer.tpl line 32]: syntax error: unrecognized tag ‘var’ (Smarty_Compiler.class.php, line 590)

Answer

Thnak you for contacting starredreviews for you question. The issue you are observing can be fixed by wrapping the javascript between {literal} and {/literal}. The whole code should be put just above </body> and after </div> (which is above </body> . Here is how the whole thing looks like.

</div>

{literal}
<script type=”text/javascript”>//<![CDATA[
// Google Analytics for WordPress by Yoast v4.06 | http://yoast.com/wordpress/google-analytics/
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’,’UA-2509289-18′]);
_gaq.push([‘_trackPageview’]);
(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
// End of Google Analytics for WordPress by Yoast v4.0
//]]></script>
{/literal}

</body>

Adding Google Analytics in the openautoclassifieds will greatly help you analyze the traffic pattern and if the user is able to find the relevant content. Analyze the bounce rate and the number of pageviews per visit and the average time spent on the website. Maximising the number of number of pageviews per visit and the time of site and minimizing the bounce rate is key to the success of a website.

 

 

Categories: Uncategorized Tags:
  1. No comments yet.