Changing a GA4 Data Stream name

You would think changing a Data Stream’s name in Google Analytics 4 would be simple right?! Wrong! This post will show you how do it using the Admin API – the only way to currently do it.



Update 30th May 2022:

So it seems Google have finally rolled out an edit button to adjust the Data Stream name and URL! It took a while, but now you don’t need to use the API workaround method detailed in this post (although you could if you wanted to).

GA4 data stream edit icon

You might think that changing your Data Stream name in Google Analytics 4 (GA4) would be simple, but it is not. You might also think that this sort of thing would be obvious to add as a feature after now 18 months since it officially came out of beta, but it isn’t apparently.

The long and short of it is that you cannot change a Data Stream name once you set one up in the interface. Well you can, just not from within the interface itself, you need to you the Google Analytics Admin API. Which is itself in early access and subject to change.

Google Analytics Admin API early preview warning message

As of the time of writing this post, the method detailed below works.

Checking the Data Stream

When creating a web Data Stream from withing the GA4 UI, you only have have to add two things; the website’s domain and a name.

Google Analytics 4 creating a new Data Stream screen

The Data Stream name is what you will be using in the reporting and analysis, so this should be something you will understand and/or recognise across the business.

For example, my two Data Stream names are:

Google Analytics 4 exploration free-form showing the Stream name dimension

Let’s say you (or someone else) misspelled the name of the Data Stream when setting it up. Or even if the name needs to be updated when adding in a few other Data Streams so that you can tell them apart. There is no edit button in the GA4 UI to go in and edit or update this. The only option you have is to delete the whole Data Stream – which is not ideal.

Using the API

The only way to update the Data Stream name is to use the Admin API v1.0 (early preview). Yes, really. But, it’s actually not that hard to use – you don’t have to know how to call APIs, be a developer or anything like that. In the developer documentation, Google provides a way to ‘try’ the API in a panel on the right hand side of the screen. And it is this feature that we can use to update the Data Stream names.

Google Analytics Admin API documentation try method panel

To update the Data Stream name, go to https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/properties.dataStreams/patch and add to the “name” field:

properties/PROPERTY_ID/dataStreams/DATA_STREAM_ID

where PROPERTY_ID and DATA_STREAM_ID is replaced with the Property and Data Stream IDs that you intend to rename. And then add to the “updateMask” field:

displayName

And finally, add the name you want to update the Data Stream name to in the “Request body” section (the maximin Data Stream name length is 255 characters).

So it would look something like:

Google Analytics Admin API documentation try method panel filled in with data

Once you’re happy, click the EXECUTE button below and go through the steps to authenticate your Google account if this is your first time using the API. After a few seconds, you can refresh your GA4 admin page to then see the new name being used!

So you can go from a wrong name…

Google Analytics 4 admin Data Stream screen with a wrong name

…to the correct name within seconds.

Google Analytics 4 admin Data Stream screen with the correct name

Note: There is currently no way to update the domain via this method, sorry.


Newsletter

Sign up to receive all this content to your inbox as soon as it’s published.

I never abuse email addresses, or any other contact details for that matter, and only ever share my own content. Promise.

Processing…
Success! You're on the list.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s