Select to view content in your preferred language

Provide ability to track ArcGIS Experience Builder interactions with Google Analytics

19628
56
10-19-2020 10:20 AM
Status: Implemented
PeterKnoop
MVP Regular Contributor

Add support for Google Analytics to Experience Builder. Keep it simple, as was done in StoryMaps and Hub, where you have a setting or property for each Experience into which you can paste your Google Analytics Tracking ID.

[Original GeoNet thread: Google Analytics with Experience Builder?]

56 Comments
GeoprocessamentoCarusoJR

please provide it. its much necessary to us

DMar
by

@FredericPoliart_EsriAU , 

In order for your solution to work, do you have to activate the EUEI agreement for all users to your portal/AGOL site? 

In the embed that is created, does it need anything on the URL side, or just the code you entered, and the changes to my specific Google Analytics Tag? 

abdhassa

@FredericPoliart_EsriAU 

I tried using the embed widget and also tried using both the G4 tag and the universal tag with no success. Is their anything else we need to do to get it to work?

PeterKnoop

@FredericPoliart_EsriAU I tried your suggested workaround using an Embed widget however, it did not work for me. Does it matter where the Embed widget is placed on the page, relative to other content? Did you actually get this solution to work at some point, or was it just an idea to try?

KevinMWright13

Do we know if this has been added to the Road Map?  Any idea when it may be released? 

FredericPoliart_EsriAU

@PeterKnoop yes it works on my page. 
We've gone live (soft open) https://fam.brisbane.qld.gov.au 

FredericPoliart_EsriAU_1-1663558183063.png

 

FredericPoliart_EsriAU_0-1663558146214.png

 

Kara_Shindle

@FredericPoliart_EsriAU Nice app!  Do you mind sharing how you got the "Techincal FloodWise Property Report" to generate?  I'm interested in doing something similar.

PeterKnoop

@FredericPoliart_EsriAU when I look at your app's source, I see that the Google Analytics script is in the <head> of the HTML page, not as part of a Experience Builder Embed widget, which would put it in an <iframe> in the <body>. Did I misunderstand your original suggestion, which I read as using the out-of-the-box Embed widget in Experience Builder?

The suggested Idea here was also meant for the regular Experience Builder environment, not the developer edition. It looks like your site was built using the developer edition, which means it is easy to insert the Google Analytics script in the <head>. I don't believe you can do that in the regular edition, or is there something I am missing here?

Thanks!

FredericPoliart_EsriAU

Thanks @Kara_Shindle .  
The FloodWise Property report is generated like this:

1. We create another separate ExB app that has just one huge custom widget (imagine a widget that is the width of a piece of paper and tall like 6 pieces of paper)

2. Inside that widget we nest a standard Map Widget (to show the map and zoom-to property)

3. Inside that widget we have an area of bar-graph showing the property's highest and lowest level, together with other metrics values. It is basically a JavaScript canvas that draws the bar chart;  The axis are dynamically calculated based on the height of the bars in the bargraph. 
The ExB also consumes a web map table, called "metrics" - we query that table to render the bar graph in JavaScript. 

4. Once the html is rendered, we use a lambda process (hosted on AWS) to convert it to PDF and return it to the client.    

FredericPoliart_EsriAU_0-1663674003634.png


This one's nice too 🙂 
https://franklincountypa.maps.arcgis.com/apps/webappviewer/index.html?id=22d612cb86914276aa9c47e1bff...

FredericPoliart_EsriAU

@PeterKnoop   correct,  we pre-load google analytics on startup in the <head> but then we also have hidden <embed> tags throughout the experience builder app.   On Google Analytics we get a bit more information on specific sub-pages .