1

I didn't success to integrate Google Analytics in Adobe Digital Publishing Suite.

What I done is create a dummy html file that include ga script as :

<!DOCTYPE html>
<html>
<body>
<script>
  (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','ga');

  ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none' });
  ga('send', 'pageview');

</script>
</body>
</html>

If I try on my localhost, I can see the page on the live google analytics, but if a make a html object on DPS, export it, I can see my white page but not the live stats in GA.

Is that someone success to do it and how ?

Dam
  • 579
  • 6
  • 22

1 Answers1

0

Did you embed the html in the app/magazine? If this is the case, the webview probably adds file: before the url of the GA javascript file (so it can not be found). You can manually add https: to prevent this.

Your code should be like this:

  (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','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none' });
  ga('send', 'pageview');