LCS - Adding Google analytics to a Betty blocks site or page.

Often for data analysis and metrics it's useful to capture user behavior in an application. A common tool for this is Google Analytics. The LCS Service Team has created a custom component in Betty Blocks to enable google analytics on a page. This Guide will walk through how to install and configure the component and pages to collect GA4 data.

Usage and considerations 

Collecting user data to track application usage falls under the guidelines of GDPR that govern the collection of personal data for EU residents. As well some US regulations restrict what data an application can collect. If you are unsure about whether your application can use google Analytics reach out to the LCS team via lcs-support@doit.wisc.edu for a consult. 

Prerequisites 

Access to Google Analytics 

Installation 

To install the Google Analytics component: 

  1. Open the Blocks Store and switch the location of blocks from “Public Blocks” to “UW Store” or “All Blocks.
     Block store
  2. Now search for Google Analytics this will display the Block that the LCS team has made available to all UW developers. 
  3. Click install block and select the organization and then the application to install the component into. 
  4. Back in the application open a page that will capture google analytics data. 

Usage 

With the component installed we can set it up on our page and configure it. 

  1. In the Components tab on the left side under the content section a Google Analytics Component is now available. Drag the component onto the canvas.  
  2. Select the Component and on the left side configuration options update the GA4 tracking ID with the ID for your Application.  
  3. Next click on the Page Settings tab and ensure that you have filled in a Page Title for the page to capture the page name correctly. If not set Betty Blocks will set the page name to “Betty Blocks” for any page that does not have a Page Title set.
    component Setup 
  4. With that set save the page settings and Google analytics is configured for your page. Repeat these steps on any page you would like to have GA4 installed on or consider adding it to the footer partial of your app to auto install it on every page. 

See also

LCS - Using Web Analytics for apps within Health Care Component



Keywords:
GA, Analytics, page views 
Doc ID:
136956
Owned by:
Joel H. in Low Code Solutions
Created:
2024-04-25
Updated:
2024-12-10
Sites:
DoIT Enterprise Business Systems - Low Code Solutions