How can we add Google Analytics and other analytics?

Discussion in 'Installation and "How-To" Questions' started by KonstantinosS, Sep 30, 2015.

  1. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    Hi, I'm trying to figure out how to enable Google Analytics, as well as any other analytics one may want (ie. Facebook pixels) both for our company, and for resellers without having to re-enter everything after updates. Any help would be greatly appreciated!

    Thanks in advance!
     
  2. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Konstantinos,
    OBAS Online Store do not has Google Analytics or other statistics built-in support. It is rather complicated to say that they could be used at all, and in which manner.

    Feature request added, with internal id PBAS-30126 for your reference
     
    Last edited: Sep 30, 2015
  3. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    Hi dkolvakh,

    Thanks for the reply and the request! Could I push for a Universal Analytics integration instead of the older version of GA? Perhaps instead, you could have a field to include any custom tracking codes we may be interested in?

    While that feature gets checked, could we implement such tracking through a custom head template?

    I've added this code on html_header.html.php and will be testing it to see if it tracks things:
    Code:
    <!-- Google Analytics Code -->    
        <script type="text/javascript">
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');
    
        __gaTracker('create', 'UA-XXX-X', 'subdomain.domain.com');
        __gaTracker('set', 'forceSSL', true);
        __gaTracker('require', 'displayfeatures');
        __gaTracker('require', 'linkid', 'linkid.js');
        __gaTracker('send','pageview');
    
    </script>
        <!-- End of GA Code -->
    
    Would that work or would it cause issues?

    Thanks again for the reply!
     
  4. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Konstantinos, I'll add your comments to the feature, to investigate possibility to add abstract "Analytics code".

    According to the your next comment, I cannot say authentically what can be a best place(s) to keep the code. This question require additional investigation, because, as you know, new Store is extremely close to the One Page Checkout and many of the content / configuration steps are loaded in background keeping the same page open. But, html_header.html.php is a rather good place: it will be used in all three steps - Configuration, Checkout/Pay, Confirmation.
     
  5. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    As far as the header goes, it records the traffic in GA, and in Facebook pixels. As for revenue, that can be a bit trickier, but tracking the visit does work with Universal Analytics from Google.
     
  6. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Hello.

    Google Analytics can be now embedded easily in OBAS Store. If you are interested, I can provide an RPM for testing purposes with this feature enabled.

     
  7. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    Hi and sorry for the late reply!

    Sure, can you provide a link to the rpm so that I can test it on the live store? Also, does it include only Google's Analytics, or can we implement other analytic options, such as tracking pixels, etc.?

    Thanks a million again dkolvakh!
     
  8. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    It include only Google Analytics support. I'll send you a download link soon.
    To investigate possibility to make universal solution, I need a list of most popular tracking engines.
     
  9. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    I would suggest allowing providers, as well as their resellers, to add any custom tracking code by utilizing a plain text area field, instead of focusing on just a handful of analytics. However, Google Analytics is indeed a must have for any serious tracking, so thank you for implementing it.
     
  10. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Well, rpm of Dynamic Store with GA support is in attachment.
    Configuration is easy, all could be done using web-interface https://<store.url>/shop/en/configuration/settings:

    Store_Settings_GA.png

    List of templates that have a sense to track is also predefined. All that you need to start using Google Analytics - type own a GA_TRACKING_ID.
    Looking forward for your feedback.
     

    Attached Files:

  11. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Well, Konstantinos. Did you try this feature? Can you please share your opinion, does it fulfill your needs?
     
  12. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    Sorry for the late reply, I've got it installed, and seems to work so far. Thanks for the rpm, and the revenue share for affiliates!
     
  13. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    Hello. Thank you for your feedback, KonstantinosS. Please let me know, if something could be improved in this feature.
     
  14. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    Hi dkolvakh!

    I ran into the following issue today:
    [​IMG]
    The issue occurs when I have the GA ID entered, but doesn't when I have it off, and revert to the custom header file.

    Other than that, future feature requests could include a blank text area to include other custom tracking code, including tracking pixels, webmaster tools, etc.
     
  15. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    KonstantinosS, it's better to look closely to your situation, so if you prefer I can create an RT for this.
     
  16. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    @dkolvakh, sure, let me know what you need from my end.
     
  17. dkolvakh

    dkolvakh Odin Team

    Messages:
    348
    KonstantinosS, RT #2034027 was created for further investigations.
     
  18. KonstantinosS

    KonstantinosS Mega Poster

    Messages:
    113
    Thanks @dkolvakh!
     

Share This Page