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
Traffic and page view tracking
Traffic and page view tracking
See which pages users visit most, where they come from, and how long they stay.Try this prompt:Rocket creates: GA4 script injection, automatic page view events on route changes, and UTM parameter forwarding.
Conversion goals
Conversion goals
Track key actions like signups, form submissions, and purchases as GA4 conversion events.Try this prompt:Rocket creates: custom event triggers on form submit and button click, plus GA4 event parameters.
E-commerce tracking
E-commerce tracking
Send product views, add-to-cart actions, and purchase events to GA4 for revenue reporting.Try this prompt:Rocket creates: data layer events for
view_item, add_to_cart, and purchase with product and revenue data.Audience insights
Audience insights
Understand your user demographics, devices, and geographic distribution.Try this prompt:Rocket creates: custom user property assignments on login and signup, forwarded to GA4.
Event-based custom tracking
Event-based custom tracking
Track any interaction as a custom GA4 event with parameters you define.Try this prompt: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.
G- (for example, G-XXXXXXXXXX).
Detailed setup
- Web Browser
- Mobile App
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.


- Open any project and go to Integrations.


- Click the Google 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.
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.


Prompt cookbook
Copy-paste these prompts after connecting Google Analytics to track common metrics:| Use case | Prompt |
|---|---|
| Page views | Track page views on every route and send them to Google Analytics automatically. |
| Button clicks | Track clicks on the "Sign Up" and "Contact Sales" buttons as GA4 custom events. |
| Form submissions | Send a conversion event to GA4 when users submit the contact form. |
| E-commerce purchase | Track completed purchases with order total, product names, and quantities in GA4. |
| Scroll depth | Track when users scroll past 25%, 50%, 75%, and 100% of the page. |
| Outbound links | Track clicks on external links as GA4 events with the destination URL. |
| Search tracking | Send a search event to GA4 when users use the site search bar, including the query. |
| Video engagement | Track play, pause, and completion events for embedded videos in GA4. |
| UTM attribution | Parse UTM parameters from the URL and forward them to GA4 as campaign data. |
| User properties | Set 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.






