You have already familiarized yourself with the basics of tags, triggers, and variables in Google Analytics. It's time to expand your knowledge with a specific type of variable: the constant. Constants are useful because they represent a fixed value that you can use repeatedly without having to enter it again. In this guide, you will learn how to create a constant variable to keep your tracking data consistent.
Key Takeaways
- A constant is defined as a fixed variable to avoid repeated inputs.
- You can use constants for categories, labels, or values to ensure consistency in your data.
- Creating a constant variable is simple and saves time when tracking events.
Step-by-Step Guide
To create a constant as a variable in Google Analytics, follow these steps:
First, navigate to the settings in Google Tag Manager. Here, go to the "Custom" section.

In the next step, create a new variable. Name this variable accordingly and choose the format "Constant Variable." In this example, we will use the name "PDF Click".
Now, further configure the variable. Scroll down to the utilities until you find the option for the constant. The value is set by a string predefined by you. In this case, you could enter "PDF Click".

With this constant, a value remains constant, if for example you want to categorically save everything under "PDF Click". If you do not use the constant, you would have to enter the label for each new category.

To avoid misunderstandings, it makes sense to maintain consistency in the values. if you want to use the category multiple times, you can create it once and save yourself a lot of typing in the future.

After creating the constant, go back to your tags. You have already prepared a template for a Google Analytics tracking tag to capture an event. In this case, we are capturing the event "PDF Click". When using this category next time, you might be tempted to describe it differently, which would make your tracking data inconsistent.

Therefore, it is advisable to use constant values to avoid confusion. If you have already defined the category "PDF Click," you can simply click on the corresponding link, and the category will be automatically inserted into your tag.

This way, you can easily insert the category, action, or label and ensure that these values always match. Using constants prevents different spellings or entries from leading to erroneous analysis.

Summary
By creating constant values in Google Analytics, you can standardize and expedite your tracking data. Instead of having to repeatedly enter new values, constants serve as a central point for recurring categories, making your tracking more efficient. This is particularly helpful in ensuring consistency in your analyses.
Frequently Asked Questions
How do I create a constant variable in Google Tag Manager?Navigate to Custom Variables in Google Tag Manager, click on "New," and define a constant.
What are constant variables used for?They help maintain consistency in recurring values such as categories or labels and avoid typing errors.
Can I use constants for other values?Yes, constants can be used for categories, labels, or action values.
How do I save a created constant?After defining the constant, click "Save" to use it for future data.