Page 1 of 1

User-defined variables

Posted: Tue Dec 17, 2024 5:37 am
by ahbappy250
User-defined (or custom) variables will hold whatever value you define for them. This can be a numeric value, a specific name string, or a set of specific URLs. In our example, that's the tracking ID associated with your Google Analytics account. By the way, let's go back to creating that custom variable for your first tag.

To create the variable for your tracking ID, go to french email address list the "Variables" section within GTM. You will see a list of the built-in variables added for that property.

img-semblog
Scroll down and you will reach the "User Defined Variables" area. Click on "New" and then choose the "Constant" option for the variable configuration when prompted. Next, enter your Tracking ID as the variable value. Then click "Save" and your new variable is ready.

Now you can go back to the tag you are creating. This time do not select the "Enable overriding settings in this tag" option. Instead, choose the custom variable you just created from the "Google Analytics Configuration" drop-down menu.

This is your first tag created and configured. The last thing you need to do is configure the trigger. To configure the trigger for your first tag, click the "Trigger" box. There is a screenshot below:

img-semblog
You will then see the "Choose a Trigger" page. Click the small "+" icon in the top right corner of the page to create a new trigger . As with the tag, you must first name the trigger. Give it a name that relates to its functionality. For example, since we are creating a pageview tag that will fire for all pages on our site, we can name the trigger "All Pages".

Image


You then have the option to choose the trigger type . The trigger type defines the type of event that the trigger tells the tag to fire for. For a pageview trigger, we recommend selecting "pageview" as the trigger type.

The final step is to select when the trigger tells the tag to fire. Your options are to fire for all pages or just certain pages. Our first generic tag will apply to all pages on our site. Therefore, you should choose the “All Page Views” option.

You've seen how to set up your first tag and its trigger. Now click "Save". You'll be able to see the tag, along with any others you create, in the "Tags" area of ​​your GTM workspace:

img-semblog
Although you have created your tag, it is not yet active on your site. You need to publish your new tag for it to start collecting data and sending it to Google Analytics. Before publishing your tag, it is a good idea to test it through GTM and debug any issues you encounter.