This method of integration is required if your Google Analytics integration is already sending data to a server container. It works by creating a new Google Analytics 4 configuration that is a copy of your original GA4 configuration and will only send data to the SegmentStream server.
SegmentStream admin panel setup
- Inside the admin panel navigate to Settings > Events Tracking.
- Open the Advanced Settings menu and disable the Forward events to Google Analytics 4 option.
- Click on the field containing the Server Container URL to copy its value to your clipboard and click SAVE.
Create new data stream in your Google Analytics 4
- Sign in to your Google Analytics account and navigate to the Admin section.
- Select the account and property where your current data stream is located.
- Under the Property column, click on Data Streams.
- Click on the Add Stream button and select Web.
- You should see a notice, click yes.
- Enter your website's URL and name the stream SegmentStream GA4 Streaming.
- Click Create stream.
- Any custom events and event modifications specified in the settings of the current data stream need to be duplicated in the newly created SegmentStream GA4 Streaming stream.
- Make note of the Measurement ID of your new data stream.
Configure tags in your GTM
- Go to the Tags section in the Google Tag Manager container.
- Open your Google Tag tag (formerly known as Google Analytics: GA4 Configuration tag) and copy it.
- Rename the copied tag to GA4 Streaming Configuration.
- Set the Tag ID field to the value from the newly created SegmentStream GA4 Streaming data stream.
- In the Configuration settings set a
server_container_url
parameter and paste the value of the Server Container URL field found in your SegmentStream project into the value field.
- Click Save.
- Copy all the Google Analytics: GA4 Event type tags.
- Rename the copied event tags using the format GA4 Streaming - {event name}.
- Set the Measurement ID option of all copied event tags to the value from the newly created SegmentStream GA4 Streaming data stream.
Test and publish your GTM container
- Use the GTM Preview functionality to test if the setup is correct before publishing the changes.
- If the Preview container is successfully connected to your website you should see a notification.
- Next, click through a couple of pages on your website to make sure events are being sent to SegmentStream.
- Then, open your Google Analytics settings page in the SegmentStream admin panel.
- If the message is highlighted in red, try clicking on the refresh button.
- If the message persists, it means that data hasn't been collected yet. You should make sure you followed the guide correctly or contact our support team.
- If you see a message highlighted with green, informing you that data has been collected, you can Publish the GTM container.