Announcement

Collapse
No announcement yet.

How to add Google Analytics to the Mobile Style

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Carbuff
    replied
    Originally posted by joeychgo View Post
    and...when/where do you call the template?
    What do you mean?

    Leave a comment:


  • joeychgo
    replied
    and...when/where do you call the template?

    Leave a comment:


  • Carbuff
    started a topic [Forum] How to add Google Analytics to the Mobile Style

    How to add Google Analytics to the Mobile Style

    Even if you add Google analytics to your website it doesn't work for the mobile style.

    It took me a while to figure this out but I figured it out eventually, should take about 3 minutes to do. You will need to know your Google analytics number (UA-1234567-89).

    Log into your admincp > style manager> (default)mobile style. Then select add a new template.
    For the template name put: headinclude_bottom

    The code: (Don't forget to replace UA-*******-** with your Google analytics number)

    Code:
     {vb:cssfile additional.css}
    {vb:raw template_hook.headinclude_bottom_css}
    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-*******-**']);
      _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); })(); </script>
    Last edited by Carbuff; Mon 28th Jan '13, 10:41am.

Related Topics

Collapse

Working...
X