logo

Advanced GTM

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

  1. Inside the admin panel navigate to Settings > Events Tracking.
  1. Open the Advanced Settings menu and disable the Forward events to Google Analytics 4 option.
  1. Click on the field containing the Server Container URL to copy its value to your clipboard and click SAVE.
Image without caption

Create new data stream in your Google Analytics 4

  1. Sign in to your Google Analytics account and navigate to the Admin section.
  1. Select the account and property where your current data stream is located.
  1. Under the Property column, click on Data Streams.
    1. Image without caption
  1. Click on the Add Stream button and select Web.
    1. Image without caption
  1. You should see a notice, click yes.
    1. Image without caption
  1. Enter your website's URL and name the stream SegmentStream GA4 Streaming.
    1. Image without caption
  1. Click Create stream.
  1. 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.
    1. Image without caption
  1. Make note of the Measurement ID of your new data stream.
    1. Image without caption

Configure tags in your GTM

  1. Go to the Tags section in the Google Tag Manager container.
  1. Open your Google Tag tag (formerly known as Google Analytics: GA4 Configuration tag) and copy it.
    1. Image without caption
  1. Rename the copied tag to GA4 Streaming Configuration.
  1. Set the Tag ID field to the value from the newly created SegmentStream GA4 Streaming data stream.
  1. 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.
    1. Image without caption
  1. Click Save.
  1. Copy all the Google Analytics: GA4 Event type tags.
    1. Image without caption
  1. Rename the copied event tags using the format GA4 Streaming - {event name}.
  1. Set the Measurement ID option of all copied event tags to the value from the newly created SegmentStream GA4 Streaming data stream.
    1. Image without caption

Test and publish your GTM container

  1. Use the GTM Preview functionality to test if the setup is correct before publishing the changes.
    1. Image without caption
  1. If the Preview container is successfully connected to your website you should see a notification.
    1. Image without caption
  1. Next, click through a couple of pages on your website to make sure events are being sent to SegmentStream.
  1. Then, open your Google Analytics settings page in the SegmentStream admin panel.
    1. Image without caption
  1. If the message is highlighted in red, try clicking on the refresh button.
  1. 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.
  1. If you see a message highlighted with green, informing you that data has been collected, you can Publish the GTM container.