Announcement

Collapse
No announcement yet.

How to add Google Analytics to the Mobile Style

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

  • [Forum] 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.
    My board: Auto Forum powered by vBulletin.

  • #2
    and...when/where do you call the template?
    vBulletin Hosting - Building my Automotive Forum Network...
    vBulletin FAQ - Lincoln vs Cadillac - Mopar Forum - Car Audio Forum - E Body Mopar Forum - B Body Mopar Forum
    Pick Up Truck Forum - C Body Mopar Forum - FMJ Body Mopar Forum - Willys and Jeep Forum

    Comment


    • #3
      Originally posted by joeychgo View Post
      and...when/where do you call the template?
      What do you mean?
      My board: Auto Forum powered by vBulletin.

      Comment

      Related Topics

      Collapse

      Working...
      X