Skip to content

Connect your app to Google Analytics

Connect your app to Google Analytics 4 to track page views, custom events, and conversions from your RShift Sites app using gtag.js.

Updated View as Markdown

Google Analytics is Google’s web analytics service. The Google Analytics connector lets your RShift Sites app send page views, custom events, and conversions to a Google Analytics 4 property using gtag.js. It’s designed for apps whose traffic and behavior reporting should live alongside the rest of your Google Analytics data.

Google Analytics is available as an app + chat connector: one shared connection that works in the project chat while you build and in your published apps.

With Google Analytics, your app can:

  • Track page views across the app, including client-side route changes
  • Send custom events for clicks, sign-ups, and conversions
  • Measure traffic sources, sessions, and user engagement
  • Feed the reports and dashboards in your Google Analytics property

This connector syncs your GA4 measurement ID to your app’s browser code, which loads gtag.js from Google. It is send-only: your reports stay in Google Analytics, and RShift Sites does not read your analytics data back into the app.

Common use cases and example apps

Use Google Analytics when you want your RShift Sites app’s traffic and conversion data in a GA4 property alongside your other sites.

Example app Example prompt Description
Marketing site with traffic reporting Use Google Analytics and build a marketing site that reports page views for every landing page. See which pages bring traffic.
The app loads gtag.js once at startup and sends a page view for each route so sessions and sources show up in your GA4 reports.
Waitlist landing page Use Google Analytics and build a waitlist page that tracks form starts and completed signups as events. Measure landing-page conversion.
The app sends a custom event when a visitor starts the form and another when the signup succeeds, so you can see where people drop off.
SaaS onboarding funnel Use Google Analytics and track each onboarding step so we can see where new users stall. Instrument a multi-step funnel.
The app sends one named event per step, letting you compare completion rates between steps in GA4.
Store with purchase tracking Use Google Analytics and send a purchase event with order value whenever a checkout completes. Attribute revenue to traffic sources.
The app sends a purchase event with the order value after checkout so GA4 can tie revenue back to campaigns.
Content or blog site Use Google Analytics and track article views and scroll depth on our blog. Understand which content holds attention.
The app reports a view for each article route and sends engagement events as readers move down the page.
Campaign landing pages Use Google Analytics and build campaign landing pages that keep UTM parameters so I can compare ad channels. Compare paid channels in GA4.
The app preserves campaign parameters on entry and reports conversions against them in your acquisition reports.

How to connect Google Analytics

Who can create Google Analytics connections depends on your plan and workspace settings. App + chat connectors are available by default on Free, Pro, and Business plans. On Enterprise plans, they are effectively disabled at first: Who can create connections and clients defaults to No one until an admin changes it in Connectors → Admin settings → App + chat connectors.

You can create multiple Google Analytics connections using different measurement IDs, which is useful for separating environments (for example, development and production) or reporting into more than one GA4 property.

When the connection is created, you can link it to the projects where you want to use it. Anyone building in a project can ask RShift Sites in the project chat to link their project to it.

Prerequisites

Before connecting Google Analytics, make sure you have:

  • A Google Analytics account with a Google Analytics 4 property
  • A web data stream in that property
  • The stream’s measurement ID, which starts with G-
  • Permission to create connections in your RShift Sites workspace (see Who can create connections and clients)

Step 1: Get your Google Analytics measurement ID

A measurement ID identifies the web data stream that receives your app’s events. It starts with G-, followed by uppercase letters and numbers.

To find your measurement ID:

Open Google Analytics

Sign in to Google Analytics with an account that has access to the property you want to use.

Open your data streams

Go to Admin → Data collection and modification → Data streams.

Select or create a web stream

Select the web data stream for your app. If the property has none, click Add stream → Web, enter your app’s URL and a stream name, then click Create stream.

Copy the measurement ID

Copy the Measurement ID from the stream details, for example G-XXXXXXXXXX.

See Google’s documentation for more: Find your Google Analytics measurement ID.

Step 2: Connect Google Analytics to RShift Sites

You can create multiple connections using different measurement IDs.

Open Google Analytics in Connectors

Open Connectors and select Google Analytics. For the other places to open the catalog from, see Where to find connectors.

Add a connection

Click Add connection.

Configure the connection

  1. Display name: name the connection, for example Google Analytics Prod. This name is only used inside RShift Sites to identify the connection. 2. Measurement ID: paste the measurement ID from your web data stream. It must start with G- followed by at least four uppercase letters or numbers.

Choose who can use this connection

Under Sharing, the connection is private to you by default and shows a Private label. To share it, click Share with others. Then add workspace members by email, or click Invite entire workspace to make the connection available to everyone in your RShift Sites workspace.

See Who can use connections and clients for more information.

Connect

Click Connect. RShift Sites does not call Google Analytics to check the measurement ID, so compare it against your data stream before you save.

When connected, anyone building in a project can ask RShift Sites in the project chat to link their project to Google Analytics (based on configured connection-level access). Your RShift Sites apps can then load gtag.js and send page views and events to your GA4 property.

Check that events are arriving

RShift Sites does not verify the measurement ID when you save the connection, so confirm collection from the Google Analytics side once your app is running:

Use your app

Open your app in a browser and move between a few pages.

Open the realtime report

In Google Analytics, go to Reports → Realtime and check that active users and page_view events appear.

Recheck the ID if nothing arrives

If no data shows up after a few minutes, confirm that the measurement ID in RShift Sites matches the data stream, and that no ad or tracking blocker is active in your browser.

Limitations

The Google Analytics connector is send-only and cannot:

  • Read your Google Analytics reporting data. It does not give your app access to the Google Analytics Data API, so you cannot build in-app dashboards or charts from your GA4 reports.
  • Send events from backend code. The measurement ID reaches your app’s browser code only, and server-side collection through the Measurement Protocol needs a separate api_secret that this connector does not hold.
  • Manage your Google Analytics configuration. Create and edit properties, data streams, conversions, and audiences in Google Analytics.
  • Check the measurement ID when you save the connection. A correctly formatted but wrong ID saves without an error and events go nowhere.
  • Revoke a measurement ID. Deleting the connection removes it from RShift Sites, but the ID stays valid. To stop collection, disable or delete the data stream in Google Analytics.
  • Support per-end-user Google Analytics login. Each connection represents a single measurement ID shared across all projects linked to it.

Manage your {connector_0} connection

Connections are managed from Connectors: select {connector_0}, then open the connection.

  • Unlink projects to remove {connector_0} access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
  • Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use {connector_0} stop working until a new connection is added. See Delete a connection for the steps and who can delete.
Navigation

Search for a question, a feature, or a task.

↑↓ to navigate↵ to openEsc to close