Google Analytics 4 Tracking in Sparkforge Workflows
Sparkforge sends GA4 events through the Add to Google Analytics workflow action. You need a Measurement ID and API Secret from your GA4 Data Stream, then paste them into the workflow. Data takes 24-48 hours to appear in GA4.
The Add to Google Analytics workflow action handles both GA4 and Universal Analytics. Pick GA4 from the Action Type dropdown to send server-side events from Sparkforge into your GA4 property.
What you need
- A GA4 property with at least one Data Stream
- The Measurement ID from that Data Stream
- An API Secret from the same Data Stream
- A Sparkforge workflow with relevant triggers
Step 1: Add the GA action to a workflow
- Open or create a workflow in Sparkforge.
- Add the Add to Google Analytics action.
- Under Action Type, choose Google Analytics 4.
Step 2: Pull the Measurement ID
- In Google Analytics, go to Admin > Account Settings > Data Stream and pick the stream you want to track.
- Copy the Measurement ID (starts with
G-). - Paste it into the Measurement ID field on the workflow action.
Step 3: Name the event
Add the event name you want to track. It will show up alongside GA4's standard events. Stick to GA4's event naming rules — letters, numbers, and underscores only.
Optional: Event Value
The action supports an optional Event Value field for sending a number with the event (revenue, order total, score). Use a static number or pull from a workflow custom value. Leave it blank if you don't need it.
Step 4: Generate the API Secret
- Back in GA4, go to Admin > Account Settings > Data Stream and select your stream.
- Open Measurement Protocol API secrets.
- Acknowledge Google's privacy disclosures and click Create.
- Name the secret, click Create, and copy the Secret Value.
- Paste it into the API Secret field in the Sparkforge action.
Step 5: Save and publish
Save the action, save the workflow, then publish. Trim any leading or trailing spaces in the API Secret — extra whitespace breaks the call silently.
Data takes 24-48 hours to appear in GA4 after the workflow runs.
Frequently Asked Questions
How long until events show up in GA4?
Can I use GA4 and Universal Analytics in the same workflow?
Do I have to send an Event Value?
Why is my GA action failing?
Was this article helpful?
Thanks for the feedback.