ArcGIS Enterprise Sites and Google Analytics

6916
16
03-17-2020 06:37 AM
AlfonsoDodero
New Contributor III

Hi ,
in my Company, we are having some issues in monitoring via Google Analytics a web page created with ArcGIS Enterprise Sites.

These were our actions:

  • we have created an Enterprise Site

  • in the edit section, we have entered the Google Analyics tracking ID for one of our google accounts (img. 1)

  •  we have configured our Google Analytics account and its property with the complete site URL
    https://webadaptorhost.domain.it/portal/apps/sites/#/ato
    -> but is not accepted, the error is "the URL must not contain fragment" (img. 2)

  • so we try to insert up to fragment and is accepted by the system

        -> we check the monitoring of the monitoring of the pages by sending test traffic (img. 3)
        -> the site mangement page opens but not traffic is detected

Since the tracking functionality via Google Analytics would natively exist, we are here to asking how to solve and
what we're doing wrong.

Thanks a lot in advance for the help.

16 Replies
Arpa_PiemonteGeoportal_Team
Occasional Contributor II

Hi all, we have the same problem and it's a huge problem... any info about release plans ?

At this time the only workaround that we have found is to embed a small js page with the GA codes, in every Sites's page. It works but clearly only for pages where you can embed an iframe: all the major components of Portal for ArcGIS (map viewer, scene viewer, gallery page etc) cannot be monitored.

0 Kudos
FabienLaganne1
New Contributor

Hi, can you tell us more about your workaround ? How do you embed GA js code into Arcgis Site pages ?

Thanks,

fabien

0 Kudos
JeffSchroeder
New Contributor II

Would you mind sharing more details of this workaround?  I am interested in what code you inserted and where within the site page to make this work.

DanMcCoy1
New Contributor III

@AlfonsoDodero ,

What version of ArcGIS Enterprise were you using?  I am unable to find where you can add a Google Analytics key to an Enterprise Site.... I see it in ArcGIS Online hubs...

Thanks,

Dan

0 Kudos
akochman
New Contributor II

I threw the gtag.js script into the index.html file located in C:\Program Files\ArcGIS\Portal\apps\sites on the enterprise server and it seems to be tracking.

Note you need to create a new property in Google Analytics with your enterprise domain, then grab the global site tag you have. Since I only put it on the "sites" specific index.html file, I believe it will only be tracking any ArcGIS Site that I create.

If I want to set it up for the entire domain (ie: the GIS home page and all sub pages), I might try injecting the script into the index.html within "C:\Program Files\ArcGIS\Portal\framework\webapps\arcgis#home", though I haven't tested that yet.

PLadd
by
Occasional Contributor III

Anybody hear from ESRI on a solution to this problem?  The issue seems to have gone cold.  It's the end of 2022 and the last post was 10 months ago.  I believe the solution provided by akochman above will work until an upgrade is installed and "C:\Program Files\ArcGIS\Portal\framework\webapps\arcgis#home" is over-written.  It's too bad this feature can exist in Hub but not in Site.  

I tried to search for the bug enhancement number but, like NormWray, could not find it.

AlfonsoDudero's attached image shows a radio button for Google Analytics.  Is this from a newer version of ArcGIS Enterprise than what I am on (10.9.1)?

kreed
by
New Contributor II

ENH-000127894 shows that its status is "In Review." During the summer 2022, the status was "In Product Plan." Seems like it was downgraded some time during the past several months. This should be a higher priority, especially since this feature is already in Hub.

0 Kudos