Google Analytics 4 lets you measure traffic and visitor behavior across your Rhythm portal — which pages members visit, how they move through the site, and how your marketing campaigns perform. You'll add your Google tag in two parts: the loader script in your site's JavaScript settings, and the configuration script as a reusable Custom Component you place on the pages you want to track. This article walks you through getting your tag from Google and installing both parts in Rhythm.
Note: This method is for a GA4 property, whose Google tag ID (Measurement ID) starts with G- (for example, G-XXXXXXXXXX). A Google Tag Manager container ID (GTM-XXXXXXX) is a separate Google product and is installed the same way in Rhythm, but it is not the same as a GA4 Measurement ID. The Google Analytics tab under Site Settings only accepts a classic Universal Analytics ID (UA-XXXXXXX) and will not work with the GA4 tag.
Before You Start: Get Your Google Tag
- In Google Analytics, go to Admin → Data Streams (under Property Settings).
- Click your web data stream to open the Web stream details.
- In the Stream details section, copy your Measurement ID (it starts with G-).
- Locate your Google tag (gtag.js) snippet, which you'll paste into Rhythm in the next steps. In Google's standard instructions this is a single snippet placed in the page
<head>, but it's made up of two<script>blocks: an async loader script (https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX) followed by a configuration block that initializes the dataLayer and runsgtag('config', 'G-XXXXXXXXXX').
Helpful Hint: You need Editor access or above on the Google Analytics property to view the Measurement ID and tag. If you can't see it, ask whoever manages your organization's Google Analytics account to grant access or send you the snippet.
Note: Rhythm intentionally splits Google's single snippet across two places — the loader goes in Site Settings and the configuration goes in a Custom Component. This is expected. If you're used to Google's instructions to paste everything into the <head> you'll be entering the same code, just in two spots.
Add the Loader Script to Site Settings
- Open the Portals & Microsites app.
- Set the site name to the portal or microsite you want to track. Click Change and select from the dropdown if you need a different site.
- Go to Site Settings → CSS & JavaScript.
- Add the loader script (the first
<script>block) into the content section and check Tag contains content. - Scroll to the bottom and click Save.
Helpful Hint: Copy the snippet directly from Google Analytics rather than retyping it, so the Measurement ID and script URL are exact.
Create the Google Analytics Custom Component
- Click Assets in the left navigation.
- Choose File → New Asset → Custom Component.
- Name the component (for example, Google Analytics), select its location, and create the asset.
- Paste the configuration block (the second
<script>block withgtag('config', ...)) into the JavaScript section at the bottom. - Click Save.
Helpful Hint: Give the component a clear, recognizable name like "Google Analytics" so it's easy to find when you're adding it to pages later.
Add the Component to Your Pages
- Open a page you want to track and drag and drop the Google Analytics component onto it.
- Repeat for each existing page you want to track.
- To track new pages automatically, add the component to your main template so every new page inherits it going forward.
- Publish your changes, then open your Google Analytics Realtime report to confirm data is coming in.
Note: For existing pages, you must drag the component onto each page individually — linking the JavaScript asset alone does not carry the tracking over.
Helpful Hint: Adding the component broadly (or through the main template) tracks your whole portal. To measure just one page, use a separate Measurement ID and component and place it only on that page. Because the portal is a single-page application, always verify by navigating between pages while watching your Realtime report, to confirm each page is recorded separately rather than lumped under the first page visited.
Comments
0 comments
Article is closed for comments.