---
title: Google Analytics with Rich Display Applications
description: Many of our customers have asked if it’s possible to integrate Google Analytics into Profound UI Rich Display applications.
image: https://blog.profoundlogic.com/hubfs/logo_lockup_analytics_icon_vertical_black_2x.png
---

[![(877) 224-7768 <>](https://no-cache.hubspot.com/cta/default/1708946/5d9809e1-1922-4e3e-b06b-d359616d29bd.png)](https://cta-redirect.hubspot.com/cta/redirect/1708946/5d9809e1-1922-4e3e-b06b-d359616d29bd)

[![sales@profoundlogic.com <mailto:sales@profoundlogic.com>](https://no-cache.hubspot.com/cta/default/1708946/4fc30eb7-f66d-4552-81e2-49cc209a5ead.png)](https://cta-redirect.hubspot.com/cta/redirect/1708946/4fc30eb7-f66d-4552-81e2-49cc209a5ead)

[![Share on facebook](https://7528309.fs1.hubspotusercontent-na1.net/hub/7528309/hubfs/raw_assets/public/mV0_d-web-default-modules_hubspot/img/facebook-color.png?width=24&name=facebook-color.png)](https://www.facebook.com/share.php?u=https%3A%2F%2Fblog.profoundlogic.com%2Fgoogle-analytics-with-rich-display-applications%3Futm_medium%3Dsocial%26utm_source%3Dfacebook) [![Share on twitter](https://7528304.fs1.hubspotusercontent-na1.net/hub/7528304/hubfs/raw_assets/public/mV0_d-web-default-modules_hubspot/img/twitter-color.png?width=24&name=twitter-color.png)](https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fblog.profoundlogic.com%2Fgoogle-analytics-with-rich-display-applications%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&url=https%3A%2F%2Fblog.profoundlogic.com%2Fgoogle-analytics-with-rich-display-applications%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&source=tweetbutton&text=)

[![Profound Logic](https://blog.profoundlogic.com/hs-fs/hubfs/PLS_Logo.jpg?width=150&height=52&name=PLS_Logo.jpg "Profound Logic")](https://www.profoundlogic.com/)

- AI-Enhanced Products 
    - [Profound AI](https://www.profoundlogic.com/ai/)
    - [Profound UI](https://www.profoundlogic.com/profoundui/)
    - [Profound.js](https://www.profoundlogic.com/profoundjs/)
    - [Profound API](https://www.profoundlogic.com/api/)
- Services 
    - Futurization and Transformation 
          - [Profound 360 Analysis](https://www.profoundlogic.com/services/profound-360-analysis/)
          - [Flexible IBM i Code Transformation](https://www.profoundlogic.com/services/flexible-code-transformation/)
          - [IBM i UX Modernization Service](https://www.profoundlogic.com/services/ibm-i-ux-modernization-service/)
          - [Database Modernization](https://www.profoundlogic.com/services/database-modernization/)
    - Integration & API Development 
          - [System Integration](https://www.profoundlogic.com/services/systems-integration/)
          - [Cloud Migration Services](https://www.profoundlogic.com/services/cloud-migration-services/)
    - [Rapid Application Development](https://www.profoundlogic.com/services/application-development/) 
          - [Application Development](https://www.profoundlogic.com/services/application-development/)
          - [Mobile Application Development](https://www.profoundlogic.com/services/mobile-application-development/)
- [Company](https://www.profoundlogic.com/about-profound-logic/) 
    - [About Us](https://www.profoundlogic.com/about-profound-logic/)
    - [Press Releases](https://www.profoundlogic.com/press-releases/)
    - [Careers](https://www.profoundlogic.com/careers/)
    - [Contact Us](https://www.profoundlogic.com/contact/)
- Resources 
    - [Blog](https://www.profoundlogic.com/blog/)
    - [Case Studies](https://www.profoundlogic.com/case-studies/)
    - [On-Demand Webinars](https://www.profoundlogic.com/webinars/)
    - [White Papers](https://www.profoundlogic.com/white-papers/)
    - [Product Documentation](https://profoundlogicsupport.atlassian.net/wiki/spaces/PUI/overview)
    - [User Forum](https://forum.profoundlogic.com/)
    - [Contact Support](https://profoundlogicsupport.atlassian.net/servicedesk/customer/portal/1)

[![Contact Us](https://no-cache.hubspot.com/cta/default/1708946/interactive-172756632938.png)](https://blog.profoundlogic.com/hs/cta/wi/redirect?encryptedPayload=AVxigLIB%2BvnZXEwwxvEtmDLBtLyMWyR0DXLqtuTKNrWjukh0B%2F2%2BWMF%2BzLWVkHd73RsJEsGHD2oBxE2yNmcX0Z4KKFhBCMtENmVXyoxffzuahwrLV%2BpATdCa8gC4oQkwOcK8evuqTjsC3oZuBLsA98c3pxUunXm2IpEKsm5715ibuioAcuJuovvPRG40&webInteractiveContentId=172756632938&portalId=1708946)

# iModernize - The Profound Logic Software Blog

# Google Analytics with Rich Display Applications

Posted by [Niral Pokal](https://blog.profoundlogic.com/author/niral-pokal) on Mar 15, 2017 12:00:00 PM

- [Tweet](https://twitter.com/share)

Many of our customers have asked if it’s possible to integrate Google Analytics into [Profound UI](http://www.profoundlogic.com/products/profound-ui-modernization-suite-for-ibm-i-applications.html) Rich Display applications. Yes, this is certainly possible! In fact, it’s quite simple to incorporate Google Analytics into all of your Rich Display applications. This post will show you how to go about tracking website usage in Profound UI using Google Analytics.

To accomplish this, I’ll be using the pui.onload() event. If you aren’t familiar with this event, I suggest taking a look at our documentation for this here: [http://www.profoundlogic.com/docs/display/PUI/pui.onload](http://www.profoundlogic.com/docs/display/PUI/pui.onload). The pui.onload() event makes adding Google Analytics to your Rich Display screens an easy task. This event will get fired after every Rich Display record format is rendered. Therefore, anything you have in the pui.onload() event will happen after executing each record format. You can even set your record format names as your routes for your application. This makes it easy for Google Analytics to track usage data for your application.

You can define the pui.onload() event in an external JavaScript file. You would then place this file in the following IFS directory: /www/profoundui/htdocs/profoundui/userdata/custom. In [Profound UI](http://www.profoundlogic.com/products/profound-ui-modernization-suite-for-ibm-i-applications.html) Rich Display File development, any file placed in this IFS directory is automatically included in your project.

Another resource that will be helpful for this example is the Single Page Application (SPA) tracking documentation that Google provides. You can find this documentation here: [https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications](https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications).

Now you that you have all the basic information you will need to accomplish this, the only thing that’s left to do is to write your code! I included an example below of how to use the pui.onload() event with Google Analytics:

pui.onload = function(){

var recordFormats = currentFormatNames(); var format = ('/'+ recordFormats\[0\]);

if(window.ga == null){

(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');

window.ga('create', YOUR-ANALYTICS-ID, 'auto');

window.ga('set', 'page', format);

window.ga('send', 'pageview');

} else {

window.ga('set', 'page', format);

window.ga('send', 'pageview');

}

}

This example first checks to see if the Google Analytics script is loaded. If it is not loaded, it will load the script and send the initial tracking information. Finally, it sends a pageview to a route based on the record format name. In order to do this, I used the currentFormatNames() API, which returns a list of the record formats that are currently displayed. If you’d like more information on this API, you can find it here: [http://www.profoundlogic.com/docs/pages/viewpage.action?pageId=20938790](http://www.profoundlogic.com/docs/pages/viewpage.action?pageId=20938790).

And there you have it! You can now use Google Analytics with your Rich Display applications.

Search Blog

### Subscribe to Blog Updates

**...and get the The 2016 State of IBM i Modernization**

![Binded_Cover_Transparent_final.png](https://blog.profoundlogic.com/hs-fs/hubfs/Binded_Cover_Transparent_final.png?width=621&name=Binded_Cover_Transparent_final.png "Binded_Cover_Transparent_final.png")

### Recent Posts

### Posts by Topic

- [Events & Education (203)](https://blog.profoundlogic.com/topic/events-education)
- [Application modernization (173)](https://blog.profoundlogic.com/topic/application-modernization)
- [IBM i Modernization (169)](https://blog.profoundlogic.com/topic/ibm-i-modernization)
- [IBM i applications (169)](https://blog.profoundlogic.com/topic/ibm-i-applications)
- [Profound.js (165)](https://blog.profoundlogic.com/topic/profound-js)
- [Node.js (164)](https://blog.profoundlogic.com/topic/node-js)
- [Agile modernization (162)](https://blog.profoundlogic.com/topic/agile-modernization)
- [IBM i (161)](https://blog.profoundlogic.com/topic/ibm-i)
- [RPG (158)](https://blog.profoundlogic.com/topic/rpg)
- [AS400 modernization (157)](https://blog.profoundlogic.com/topic/as400-modernization)
- [iSeries (149)](https://blog.profoundlogic.com/topic/iseries)
- [Legacy Modernization (141)](https://blog.profoundlogic.com/topic/legacy-modernization)
- [RPG Development (85)](https://blog.profoundlogic.com/topic/rpg-development)
- [AS 400 (58)](https://blog.profoundlogic.com/topic/as-400)
- [Profound UI (54)](https://blog.profoundlogic.com/topic/profound-ui)
- [Profound Logic (50)](https://blog.profoundlogic.com/topic/profound-logic)
- [AS\_400 (49)](https://blog.profoundlogic.com/topic/as_400)
- [New Features (28)](https://blog.profoundlogic.com/topic/new-features)
- [Tips and Tricks (26)](https://blog.profoundlogic.com/topic/tips-and-tricks)
- [Development (20)](https://blog.profoundlogic.com/topic/development)
- [green screen modernization (15)](https://blog.profoundlogic.com/topic/green-screen-modernization)
- [Mobile Development (14)](https://blog.profoundlogic.com/topic/mobile-development-2)
- [5250 (12)](https://blog.profoundlogic.com/topic/5250)
- [IBM Watson (10)](https://blog.profoundlogic.com/topic/ibm-watson)
- [Press Release (9)](https://blog.profoundlogic.com/topic/press-release)
- [Product Announcement (9)](https://blog.profoundlogic.com/topic/product-announcement)
- [Scott Klement Health (7)](https://blog.profoundlogic.com/topic/scott-klement-health)
- [Partnerships (6)](https://blog.profoundlogic.com/topic/partnerships)
- [PLUS 2018 (5)](https://blog.profoundlogic.com/topic/plus-2018)
- [Prime UI (5)](https://blog.profoundlogic.com/topic/prime-ui)
- [Case Study (4)](https://blog.profoundlogic.com/topic/case-study)
- [Enterprise Modernization (3)](https://blog.profoundlogic.com/topic/enterprise-modernization)
- [Year in review (3)](https://blog.profoundlogic.com/topic/year-in-review)
- [PLUS 2019 (2)](https://blog.profoundlogic.com/topic/plus-2019)
- [mobile applications (2)](https://blog.profoundlogic.com/topic/mobile-applications)
- [mobile mondernization (2)](https://blog.profoundlogic.com/topic/mobile-mondernization)
- [2016 Survey (1)](https://blog.profoundlogic.com/topic/2016-survey)
- [2019 Survey (1)](https://blog.profoundlogic.com/topic/2019-survey)
- [Conversion Service (1)](https://blog.profoundlogic.com/topic/conversion-service)
- [Model 3 (1)](https://blog.profoundlogic.com/topic/model-3)
- [Tesla (1)](https://blog.profoundlogic.com/topic/tesla)
- [connectria (1)](https://blog.profoundlogic.com/topic/connectria)
- [node (1)](https://blog.profoundlogic.com/topic/node)

see all

### Archive

- [September 2014 (17)](https://blog.profoundlogic.com/archive/2014/09)
- [March 2017 (14)](https://blog.profoundlogic.com/archive/2017/03)
- [May 2017 (10)](https://blog.profoundlogic.com/archive/2017/05)
- [April 2019 (10)](https://blog.profoundlogic.com/archive/2019/04)
- [May 2019 (10)](https://blog.profoundlogic.com/archive/2019/05)
- [February 2013 (9)](https://blog.profoundlogic.com/archive/2013/02)
- [June 2017 (9)](https://blog.profoundlogic.com/archive/2017/06)
- [August 2017 (9)](https://blog.profoundlogic.com/archive/2017/08)
- [September 2017 (9)](https://blog.profoundlogic.com/archive/2017/09)
- [October 2017 (9)](https://blog.profoundlogic.com/archive/2017/10)
- [July 2017 (8)](https://blog.profoundlogic.com/archive/2017/07)
- [June 2018 (8)](https://blog.profoundlogic.com/archive/2018/06)
- [January 2019 (8)](https://blog.profoundlogic.com/archive/2019/01)
- [March 2019 (8)](https://blog.profoundlogic.com/archive/2019/03)
- [June 2019 (8)](https://blog.profoundlogic.com/archive/2019/06)
- [August 2014 (7)](https://blog.profoundlogic.com/archive/2014/08)
- [August 2015 (7)](https://blog.profoundlogic.com/archive/2015/08)
- [December 2017 (7)](https://blog.profoundlogic.com/archive/2017/12)
- [January 2018 (7)](https://blog.profoundlogic.com/archive/2018/01)
- [July 2018 (7)](https://blog.profoundlogic.com/archive/2018/07)
- [August 2018 (7)](https://blog.profoundlogic.com/archive/2018/08)
- [October 2018 (7)](https://blog.profoundlogic.com/archive/2018/10)
- [June 2014 (6)](https://blog.profoundlogic.com/archive/2014/06)
- [October 2014 (6)](https://blog.profoundlogic.com/archive/2014/10)
- [September 2015 (6)](https://blog.profoundlogic.com/archive/2015/09)
- [April 2017 (6)](https://blog.profoundlogic.com/archive/2017/04)
- [November 2017 (6)](https://blog.profoundlogic.com/archive/2017/11)
- [March 2018 (6)](https://blog.profoundlogic.com/archive/2018/03)
- [November 2018 (6)](https://blog.profoundlogic.com/archive/2018/11)
- [December 2018 (6)](https://blog.profoundlogic.com/archive/2018/12)
- [February 2019 (6)](https://blog.profoundlogic.com/archive/2019/02)
- [January 2014 (5)](https://blog.profoundlogic.com/archive/2014/01)
- [April 2014 (5)](https://blog.profoundlogic.com/archive/2014/04)
- [October 2015 (5)](https://blog.profoundlogic.com/archive/2015/10)
- [February 2018 (5)](https://blog.profoundlogic.com/archive/2018/02)
- [April 2018 (5)](https://blog.profoundlogic.com/archive/2018/04)
- [July 2020 (5)](https://blog.profoundlogic.com/archive/2020/07)
- [January 2013 (4)](https://blog.profoundlogic.com/archive/2013/01)
- [March 2013 (4)](https://blog.profoundlogic.com/archive/2013/03)
- [April 2013 (4)](https://blog.profoundlogic.com/archive/2013/04)
- [July 2014 (4)](https://blog.profoundlogic.com/archive/2014/07)
- [May 2018 (4)](https://blog.profoundlogic.com/archive/2018/05)
- [September 2018 (4)](https://blog.profoundlogic.com/archive/2018/09)
- [July 2019 (4)](https://blog.profoundlogic.com/archive/2019/07)
- [September 2013 (3)](https://blog.profoundlogic.com/archive/2013/09)
- [March 2014 (3)](https://blog.profoundlogic.com/archive/2014/03)
- [July 2015 (3)](https://blog.profoundlogic.com/archive/2015/07)
- [November 2015 (3)](https://blog.profoundlogic.com/archive/2015/11)
- [January 2016 (3)](https://blog.profoundlogic.com/archive/2016/01)
- [March 2016 (3)](https://blog.profoundlogic.com/archive/2016/03)
- [April 2016 (3)](https://blog.profoundlogic.com/archive/2016/04)
- [September 2016 (3)](https://blog.profoundlogic.com/archive/2016/09)
- [October 2019 (3)](https://blog.profoundlogic.com/archive/2019/10)
- [June 2020 (3)](https://blog.profoundlogic.com/archive/2020/06)
- [August 2020 (3)](https://blog.profoundlogic.com/archive/2020/08)
- [November 2013 (2)](https://blog.profoundlogic.com/archive/2013/11)
- [February 2014 (2)](https://blog.profoundlogic.com/archive/2014/02)
- [May 2014 (2)](https://blog.profoundlogic.com/archive/2014/05)
- [November 2014 (2)](https://blog.profoundlogic.com/archive/2014/11)
- [January 2015 (2)](https://blog.profoundlogic.com/archive/2015/01)
- [April 2015 (2)](https://blog.profoundlogic.com/archive/2015/04)
- [February 2016 (2)](https://blog.profoundlogic.com/archive/2016/02)
- [June 2016 (2)](https://blog.profoundlogic.com/archive/2016/06)
- [July 2016 (2)](https://blog.profoundlogic.com/archive/2016/07)
- [October 2016 (2)](https://blog.profoundlogic.com/archive/2016/10)
- [December 2016 (2)](https://blog.profoundlogic.com/archive/2016/12)
- [February 2017 (2)](https://blog.profoundlogic.com/archive/2017/02)
- [March 2020 (2)](https://blog.profoundlogic.com/archive/2020/03)
- [April 2020 (2)](https://blog.profoundlogic.com/archive/2020/04)
- [May 2020 (2)](https://blog.profoundlogic.com/archive/2020/05)
- [September 2020 (2)](https://blog.profoundlogic.com/archive/2020/09)
- [October 2020 (2)](https://blog.profoundlogic.com/archive/2020/10)
- [January 2021 (2)](https://blog.profoundlogic.com/archive/2021/01)
- [November 2012 (1)](https://blog.profoundlogic.com/archive/2012/11)
- [December 2012 (1)](https://blog.profoundlogic.com/archive/2012/12)
- [May 2013 (1)](https://blog.profoundlogic.com/archive/2013/05)
- [June 2013 (1)](https://blog.profoundlogic.com/archive/2013/06)
- [July 2013 (1)](https://blog.profoundlogic.com/archive/2013/07)
- [August 2013 (1)](https://blog.profoundlogic.com/archive/2013/08)
- [October 2013 (1)](https://blog.profoundlogic.com/archive/2013/10)
- [December 2013 (1)](https://blog.profoundlogic.com/archive/2013/12)
- [December 2014 (1)](https://blog.profoundlogic.com/archive/2014/12)
- [March 2015 (1)](https://blog.profoundlogic.com/archive/2015/03)
- [May 2015 (1)](https://blog.profoundlogic.com/archive/2015/05)
- [May 2016 (1)](https://blog.profoundlogic.com/archive/2016/05)
- [November 2016 (1)](https://blog.profoundlogic.com/archive/2016/11)
- [January 2017 (1)](https://blog.profoundlogic.com/archive/2017/01)
- [August 2019 (1)](https://blog.profoundlogic.com/archive/2019/08)
- [December 2019 (1)](https://blog.profoundlogic.com/archive/2019/12)
- [November 2020 (1)](https://blog.profoundlogic.com/archive/2020/11)
- [December 2020 (1)](https://blog.profoundlogic.com/archive/2020/12)

see all

#### Related Resources

- [\[fa icon="caret-right"\] Benefits of Modernizing Legacy Systems](https://www.profoundlogic.com/benefits-of-modernizing-legacy-systems/)
- [\[fa icon="caret-right"\] Customer Satisfaction and Supply Chains](https://www.profoundlogic.com/customer-satisfaction-and-supply-chains/)
- [\[fa icon="caret-right"\] Why Your Business Must Modernize Its Legacy Applications](https://www.profoundlogic.com/why-your-business-must-modernize-its-legacy-applications/)
- \[fa icon="caret-right"\] Coding in 2021 and Beyond: Is Node.js Dead?

#### Recommended for you

- [\[fa icon="caret-right"\] The Importance of API Security to Protect Sensitive Business Data](https://info.profoundlogic.com/the-importance-of-api-security-to-protect-sensitive-business-data)
- [\[fa icon="caret-right"\] Why API Matters for Enterprise Development](https://info.profoundlogic.com/why-api-matters-for-business-development-whitepaper)
- [\[fa icon="caret-right"\] The Cost of Technical Debt to Business on IBM i](https://info.profoundlogic.com/technical-debt)
- [\[fa icon="caret-right"\] Node.js for Enterprise IBM i Modernization](https://info.profoundlogic.com/node)

#### Watch now on demand

- [\[fa icon="caret-right"\] What is Code Transformation?](https://info.profoundlogic.com/code-transformation-stage-one)
- [\[fa icon="caret-right"\] Transform IBM i/AS400 Now](https://www.profoundlogic.com/transform-ibm-i-as400-now/)
- [\[fa icon="caret-right"\] Profound API, Low-Code and Product Updates Announced at PLUS 2020](https://info.profoundlogic.com/plus2020)
- [\[fa icon="caret-right"\] IBM i Transformation Risks Every Business Leader Should Know](https://info.profoundlogic.com/transformation-risks-wod)

#### Company

- [\[fa icon="caret-right"\] About Us](https://www.profoundlogic.com/about-profound-logic/)
- [\[fa icon="caret-right"\] Press Releases](https://www.profoundlogic.com/press-releases/)
- [\[fa icon="caret-right"\] Events and Webinars](https://www.profoundlogic.com/events/)
- [\[fa icon="caret-right"\] Careers](https://www.profoundlogic.com/careers/)
- [\[fa icon="caret-right"\] Partnerships](https://www.profoundlogic.com/partnerships/)
- [\[fa icon="caret-right"\] Contact Us](https://www.profoundlogic.com/contact/)

[Sign up for our newsletter](https://www.profoundlogic.com/newsletter-signup-profound-logic/) | [Developers](https://docs.profoundlogic.com/) | [Blog](https://www.profoundlogic.com/blog/) | [Privacy](https://www.profoundlogic.com/privacy-policy) | [Contact](https://www.profoundlogic.com/contact/) | [1-877-224-7768](tel:877-224-7768)

 Copyright © 2026 Profound Logic Software | [Sitemap](https://www.profoundlogic.com/sitemap.xml)

\[fa icon="chevron-up"\]

![](https://www.facebook.com/tr?id=237478240316292&ev=PageView&noscript=1)