Pega integration with Google Web Analytics

This post is a simple POC on how to integrate Pega with Google Web Analytics.

Demo Video:

The steps are as follows,

Login to Google web analytics.

Click Get started today

Give Analytics Account name MyPegaApp

Properties and App as MyApp

Then you will get the below screen

Now click Go to stream setup

Site name: give a meaningful name,

Click Data Stream — Click Web Stream you will get the

Stream url : (enter a meaningful name):

Stream name: (enter a meaningful name): mypegaanalytics

Measuremnt ID: will be auto generated

Now click Tagging Instructions

Global site tag – get the details and paste it in Pega – Page tab

Measurement ID is the yellow highlighted one.

<!– Global site tag (gtag.js) – Google Analytics –>

<script async src=”″></script>


  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag(‘js’, new Date());

  gtag(‘config’, ‘G-SSLE93KG36’);


Now close the web stream screen

Go to home – Check the Measurement ID (Just above the blue Get tagging instructions) – this is same as you have created in the Web stream.

Download the WebAnalytics component from Pega MarketPlace under Integrations section.

Import the component in Pega

Now go to Pega and launch the designer portal

Enable the component in the application as show below

Log off and Login

Then you will get the Web analytics under User Interface

Enable Google and disable Matomo (I have configured Matomo previously so I am getting this option otherwise, for the first time you will get Add new option only)

Click the gear icon, enter the below details in the Meta Tags

Go to App Data tab

Now click Page tab – enter the script that you received from Google Analytics site

Keep the default settings of Click and Click Post tabs (Enable the Use toggle button)

Click Post tab

Launch the User Portal

Navigate to different screens

Now login to google analytics

Check the Reports

Click Realtime

Scroll down

Cosmos application details and my case details are coming

Data is changing as am using the application more

Click Engagement overview on the left hand menu

Click Pages and Screens


To Test:

Login to

Provide the gmail id / password used during account creation and get the analysis

Once you done with the POC, Pat on your back, and say Good job. 😉


  1. Thanks for sharing !!
    Waiting for many other topics 🙂

  2. Thanks for sharing this article. I saw couple of other articles in the net, but all steps are not there. Your article has all the steps.

  3. I need to do this POC for my project. If I face issues I will let you know.

  4. Thanks for sharing. I followed the steps blindly and its a success. 🙂