Step-by-Step Guide to Configure Google Analytics™ for Experience Cloud Sites

Step-by-Step Guide to Configure Google Analytics™ for Experience Cloud Sites

Last Updated on February 7, 2025 by Rakesh Gupta

Big Idea or Enduring Question:

  • How do you configure Google Analytics™ for Experience Cloud Sites to track user IDs, user types, and search activity?

Objectives:

After reading this blog, you’ll be able to:

  1. Understand Google Analytics™ and why it’s useful.
  2. Set up Google Analytics™ Property to collect visitor data.
  3. Add the Google Analytics™ Tracking ID to your Experience Cloud Site.
  4. Monitor user activity like logins, search terms, and page views.
  5. Use insights to improve your site’s experience.
  6. And much more!

Business Use case

Olivia Bennett, a Junior Developer at Gurukul on Cloud (GoC), is part of a team working on building an Experience Cloud site for the company’s help portal. She branded the portal URL https://help.gurukuloncloud.com/ as described in this post.

Now, she has received another requirement: to configure Google Analytics™ tracking in the Experience Cloud site so the team can start monitoring user activity, including logins, search terms, and page views.

What is Google Analytics 4 (GA4)?

Google Analytics 4 (GA4) is a next-generation analytics tool designed to track user interactions across websites and apps. Unlike Universal Analytics, GA4 uses an event-based model, capturing clicks, scrolls, purchases, and more for a deeper understanding of user behavior. It also prioritizes privacy-friendly tracking by reducing reliance on cookies.

Why Does This Matter?

GA4 shifts the focus from session-based tracking to event-driven analytics, giving businesses a clearer view of user interactions while improving privacy compliance. With AI-powered insights and predictive analytics, it helps fill data gaps and forecast trends, even as third-party cookies phase out.

By leveraging GA4, businesses and agencies gain more control over tracking, enabling them to measure key actions like clicks, purchases, and engagement without relying on traditional identifiers. This ensures better decision-making while aligning with evolving data regulations. Key Features & Benefits of Google Analytics 4

  1. More Accurate Insights: Focuses on what users do, not who they are.
  2. Improved Privacy Compliance: Adapts to evolving data regulations.
  3. AI-Powered Predictions: Fills in data gaps and forecasts trends.
  4. Customizable Tracking: Agencies and businesses can define events to fit their goals.

What Can You Do with GA4?

With GA4, you get more precise tracking and deeper insights into customer behavior, allowing you to optimize content, refine marketing strategies, and improve conversions. By understanding user interactions in real-time, you can make data-driven adjustments that enhance engagement and drive better results.

Additionally, GA4’s automation and AI-driven analytics save time by providing actionable insights without manual setup. Whether you’re an agency or a business owner, this means smarter marketing, improved ROI, and a competitive edge in the evolving digital landscape.

Automation Champion Approach (I-do):

By now, you have learned the basics of Google Analytics. It’s time to set up Google Analytics™ for Experience Cloud Sites.

Step 1: Create Your Google Analytics 4 Account

To get started with Google Analytics, you’ll need to create an account. Visit the Google Marketing Platform, sign up using your Google credentials, and follow the setup instructions.

Step 2: Create a Google Analytics 4 Property

To create a new Google Analytics 4 property, go to the Admin section of your Google Analytics interface (by clicking the Admin at the bottom-left corner) and then (in the Property section) click Create Property.

  1. Click on Admin (bottom-left corner).
  2. Click + Create > Property to create a new property.
  3. Then, enter the Property Name. It might be the name of your website, your company, a brand, etc.
  4. Then click Next, and enter Business Details.
  5. Then click Next, and select your Business Objectives.
  6. Click Create.

Step 3: Create a Google Analytics 4 Data Stream

The next step is to configure your first data stream for your Experience Cloud Site. A data stream is a source from which events will be sent to your Google Analytics 4 (GA4) property. You can have multiple data streams within a single property. In this blog post, I will focus on a Web stream. 

  1. In the GA4 Admin panel, under Property Settings > Data collection and modification, click Data Streams.
  2. Click Add Stream, then select Web (for websites like Experience Cloud Sites).
  3. Then, enter your Website’s URL and Stream Name. When you create a web data stream in Google Analytics 4, you can enable/disable Enhanced Measurement. It is designed to help marketers get as many events in the reports as possible without the need to cooperate with developers or configure them in Google Tag Manager.
  4. When you’re ready, click the Create & Continue.
  5. A window will slide in, showing your data stream’s measurement ID and other details. Copy this ID for later use in Experience Cloud.

Step 4: Add Google Analytics 4 to Your Experience Cloud Site

Google Analytics integrates with your self-service site to track user types, user IDs, page views on Salesforce objects, and customer search activity. I am using Aura Site site for this demo. 

  1. In Experience Builder, navigate to Settings | Security & Privacy.
    1. Under Content Security Policy, choose Relaxed CSP: Permit Access to Inline Scripts and Allowed Hosts.
  2. Navigate to Settings | Advanced
    1. Enter your Google Analytics Measurement ID.
    2. Select Let Google Analytics access your Salesforce data for deeper insights into search activity (This allow Google Analytics to track user types, user IDs, and customer search activity in your site.).
    3. Publish your site.

After you publish your site, traffic should start flowing from your Aura site into Google Analytics, including Salesforce-specific values such as user IDs.

Proof of Concept

To check if GA4 is working, go to Reports > Real-time in Google Analytics. Open your website in a new browser window, then return to GA4. If your activity, such as location and page views, appears in the real-time report, GA4 is set up correctly.

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Go back

Your message has been sent

Warning
Warning
Warning
Warning
Warning

Warning.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.