Articles on: Server Side

Placing Your GA4 Measurement ID in a Constant Variable

To work quickly and accurately when creating and modifying GA4 event tags, place your GA4 Measurement ID in a constant variable. This way, you never have to start up GA4 and find it in the settings when you want to create a new tag. This also prevents spelling errors, ensuring all tags are set to the same Measurement ID.

Op your GA4 property

Go to settings



Go to datastreams



Click on your data stream, you'll see your "measurement-ID" in the upper right corner. Copy this ID



Open your GTM web container

Navigate over to variables



Within "User-Defined Variables", create a new variable



For the variable type, select "Constant"



For the value, past your GA4 measurement ID



Give the variable a clear name like: "GA4 Measurement-ID" and hit save

Updated on: 08/08/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!