- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2016 06:26 AM
Has anyone put Google Analytics on the Service Portal? I put it as a javascript include at the theme level. This seems to work, but only for the initial page the user hits or any refreshes. Since navigating around the portal typically doesn't involve reloading a new page, it would seem GA doesn't get the hit that the URL has changed.
I tried putting the tracking code into a widget in the header on all pages, but that didn't seem to work any better.
Any ideas? Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2016 12:09 PM
Did you create a UI script, or did you go through Service Portal > Themes > your theme > JS Includes? This is where the script will need to be. <edit: I re-read your post and saw you did that>
Also, remove the <script> tags (lines 1 & 10) from your script include. The yellow dot errors can be ignored.
That implementation should work great. I did end up combining that JS Include into the header widget as well for simplicity's sake. Here is a screenshot.
(if you choose to do it this way, you'll have to edit it in the Service Portal Configuration > Widget Editor. Editing it directly from Widgets will not let you save as the script editor barks at that red dot error, but that is code directly from Google so I left it alone)
And is working very well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 01:30 PM
Correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 03:02 PM
How does this work with the Global Site Tag? the gtag.js code?
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script> async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 10:15 AM
jesusvillanueva Any success in figuring out how to use gtag script in service portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 11:13 AM
I found out that I could achieve what I wanted with any of those two versions of google analytics script and since the first one was the only one documented I ended up using it. Theoretically the gtag can be used the same way, you just have to know the proper tags according to what you want to obtain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 07:39 AM
Thanks. I had the same experience. Could not find much documentation around
gtag however found that it won't work for older versions of the browser
since it preloads JS for gtag which only newer browser support.
Will post here if I can get gtag to work.
On Tue, Jan 16, 2018 at 4:18 PM jesusvillagomez <