I am trying to add the Google Analytics script to a locally hosted Web App Builder site. I've put the script in the Index.html file. According to the network traffic the site is sending information to Google Analytics, however, no users are being logged. Is using Google Analytics with a web app builder site allowed or has anyone gotten this to work? If so, is there a specific location where the script needs to be placed? Thank you.
Jason Buck
La Crosse, WI
Solved! Go to Solution.
Jason,
I have this in the head section of my index.html and I get analytic data.
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i=i (i||function(){ .q=i 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-My code', 'auto'); ga('send', 'pageview'); </script>.q||[]).push(arguments)},i .l=1*new Date();a=s.createElement(o),
Jason,
I have this in the head section of my index.html and I get analytic data.
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i=i (i||function(){ .q=i 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-My code', 'auto'); ga('send', 'pageview'); </script>.q||[]).push(arguments)},i .l=1*new Date();a=s.createElement(o),
Robert,
Thank you. That's where I have it as well. After checking Google Analytics again, I just realized that the date range being displayed didn't include today. It was actually tracking. Thank you for the confirmation on the script location.
Jason
Hey Jason!
I happened to stumble across this thread. Thought you might find this useful for the future
Hi Robert,
I found a widget https://github.com/igrasshoff/esri-wab-widget-google-analytics. Do you have any idea on this.
I added the widget in WAB developer edition. When I launch the application not able to view the widget
ESRI builder makes it very complicated just to include google analytics
Its very frustrating how ESRI builder having difficulties just to include google analytics. Does anyone here successfully integrated their google analytics to their Dashboard?