Google analytics integration

davidsyril
davidsyril Community Member Posts: 11
I haven't got much experience using Google Analytics integration into Lectora. I'm not sure if this is even possible. Would be great if you guys could answer my questions.

Is it possible to track a module on an LMS and a HTML version?

Would like to know if you can get a 'time on page' from each page in a module?

Is there any useful guides or links out there that would provide more information.

Thanks

Dynamic Dev team.

Comments

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    Register for Google Analytics and get your ID (UA-something-something).

    In Lectora, Add External HTML Object to your title. Set it to META tags. Enter the following code in there:
    <script>
    (function(i,s,o,g,r,a,m){i[&#039;GoogleAnalyticsObject&#039;]=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,&#039;script&#039;,&#039;https://www.google-analytics.com/analytics.js&#039;,&#039;ga&#039;);
    
    ga(&#039;create&#039;, &#039;UA-XXXXX-Y&#039;, &#039;auto&#039;);
    ga(&#039;send&#039;, &#039;pageview&#039;);
    </script>
    Replace XXXXX-Y with your own Google Analytics ID. Voila, now you can track your course in LMS or outside of LMS, the only condition is that Google server isn't blocked by e.g. a corporate firewall.

    As for what you can track, Google calls it "Session duration", so this is what you should look for in Google Analytics panel.
  • davidsyril
    davidsyril Community Member Posts: 11
    Thanks very much for the quick reply. Really useful.
  • loraguardtree
    loraguardtree Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 2 ☆ Roadie ☆
    Has anyone used this script since Google Analytics updated?