Skip to main content
Track your app’s traffic with a single prompt.Google Analytics (GA4) is Google’s web analytics platform for tracking page views, user behavior, conversions, and traffic sources.When you connect Google Analytics to Rocket, you can describe what you want to measure in chat and Rocket wires up the tracking tags, custom events, and e-commerce data layer automatically.Google Analytics works well alongside Mixpanel (for deeper event-level analysis) and Stripe (for tracking checkout conversion rates and revenue attribution).Prerequisites:
  • A Rocket account at rocket.new.
  • A Google Analytics account (free to create).
  • For mobile: the Rocket mobile app installed.

What you can use it for

See which pages users visit most, where they come from, and how long they stay.Try this prompt:
Add Google Analytics page view tracking to every route in my app.
Include UTM parameter parsing for campaign attribution.
Rocket creates: GA4 script injection, automatic page view events on route changes, and UTM parameter forwarding.
Track key actions like signups, form submissions, and purchases as GA4 conversion events.Try this prompt:
Track a conversion event when users submit the contact form.
Also track when users click the "Start Free Trial" button.
Rocket creates: custom event triggers on form submit and button click, plus GA4 event parameters.
Send product views, add-to-cart actions, and purchase events to GA4 for revenue reporting.Try this prompt:
Add GA4 e-commerce tracking to my store. Track product views,
add-to-cart clicks, and completed purchases with order totals.
Rocket creates: data layer events for view_item, add_to_cart, and purchase with product and revenue data.
Understand your user demographics, devices, and geographic distribution.Try this prompt:
Set up Google Analytics to capture user properties like plan type
and signup source. I want to segment my GA4 reports by these properties.
Rocket creates: custom user property assignments on login and signup, forwarded to GA4.
Track any interaction as a custom GA4 event with parameters you define.Try this prompt:
Track a custom event called "video_played" when users click play on the demo video.
Include the video title and duration as event parameters.
Rocket creates: custom event call with named parameters, triggered on the video play action.

Get your Measurement ID

Open the Google Analytics help center to find your Measurement ID.
Your Measurement ID is a unique identifier for your GA4 property. It starts with G- (for example, G-XXXXXXXXXX).
Never paste your Measurement ID directly into Rocket chat. Always use the secure integration flow or the input field in settings.

Detailed setup

Connect Google Analytics to Rocket

There are two ways to connect Google Analytics to Rocket:Method 1: Use Rocket Chat (fastest)
  • In any project, open the chat panel and type something like: Connect my Google Analytics account to:
  • Track button clicks on the sign-up page.
  • See when people visit the pricing page.
  • Know when someone completes a purchase.
  • A popup will appear where you can paste your Measurement ID and save it right away.
Google Analytics integration popup in chatGoogle Analytics integration popup in chat
Method 2: From your project settings
  • Open any project and go to Integrations.
Integrations tabIntegrations tab
  • Click the Google Analytics card.
Google Analytics cardGoogle Analytics card
When you connect Google Analytics from Project Settings, Rocket will not automatically set up event tracking. After saving your Measurement ID, describe what you want to track in chat for Rocket to implement it.

Save your Measurement ID

  • Paste your Measurement ID into the input field.
  • Click Save to complete setup.
A green dot next to Google Analytics in your integrations list confirms the connection.

Update or disconnect

  • Go back to the Google Analytics section in your project settings.
  • You can update your Measurement ID anytime, or click Remove to disconnect.
Remove GA ID lightRemove GA ID dark

Prompt cookbook

Copy-paste these prompts after connecting Google Analytics to track common metrics:
Use casePrompt
Page viewsTrack page views on every route and send them to Google Analytics automatically.
Button clicksTrack clicks on the "Sign Up" and "Contact Sales" buttons as GA4 custom events.
Form submissionsSend a conversion event to GA4 when users submit the contact form.
E-commerce purchaseTrack completed purchases with order total, product names, and quantities in GA4.
Scroll depthTrack when users scroll past 25%, 50%, 75%, and 100% of the page.
Outbound linksTrack clicks on external links as GA4 events with the destination URL.
Search trackingSend a search event to GA4 when users use the site search bar, including the query.
Video engagementTrack play, pause, and completion events for embedded videos in GA4.
UTM attributionParse UTM parameters from the URL and forward them to GA4 as campaign data.
User propertiesSet GA4 user properties for plan type and signup date when users log in.

Tips and limitations

  • Tracking only works on deployed projects. Google Analytics will not fire events in the Rocket preview. Deploy your project and test on the live URL.
  • GA4 data has a processing delay. Real-time reports update within seconds, but standard reports may take 24 to 48 hours to fully populate.
  • Only GA4 Measurement IDs are supported. IDs start with G-. Universal Analytics (UA-) was sunset in 2024 and no longer processes data.
  • Ad blockers may prevent tracking. Some users run browser extensions that block Google Analytics scripts. Keep this in mind when evaluating traffic numbers.
  • One Measurement ID per project. Each Rocket project connects to one Google Analytics property. Use different projects for different properties.

What’s next?

Mixpanel

Need deeper event-level analytics? Add Mixpanel for funnel analysis and user segmentation.

Stripe

Track checkout conversion rates and revenue attribution with Stripe and GA4 together.

AdSense

Monetize your traffic with Google AdSense display ads.

Netlify

Deploy your project so Google Analytics can start collecting real data.