A tag is a piece of code that you can place in your site’s code using Tag Manager. With tags you can make changes on your site on your own. No need to engage web developers in that process.
You can use tags to collect additional data, run marketing campaigns, integrate products or add any kind of code. In this article, we’ll explain how to create a tag.
To create a tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name the tag and choose a tag type. You can choose a tag type from two categories:
- Async tags: They don’t interfere with loading page content. The browser can load all tags at the same time and it doesn’t wait for a certain tag to load completely before moving to the next one. Async tags load faster than sync tags and are better for collecting data. Most of tags in Piwik PRO are async tags.
- Sync tags: They load before the page content loads. They also wait for the tag content to load before moving on to the next content. Sync tags are often used to run A/B tests.
Tip: Each tag type is described in this section.
- Click Next.
- Set up the tag. For example, in a custom event tag add:
Category
,Action
,Name
.
- In Advanced tag settings, choose Consent type. Set it up if you use a consent form on your site. This tag will fire only for visitors who accept the selected consent type.
Tip:
No consent is required
is the type you can use for tags that don’t collect data. For example, tags that add a popup or content, or tags that change the look of your site. - Respect opt-out and DNT is turned on by default. Leave it as is, if you want to respect visitors who set Do-Not-Track in their browsers, or visitors who opt out of tracking using our opt-out form.
- The tag will fire in a debug mode by default but you can change it. Turn on Don’t fire in debug mode.
- In Flight dates, set the date and time when the tag is fired.
- In Tag triggers, click Add a trigger or Choose existing trigger to set up a trigger for your tag.
Tip: You can add a trigger to a tag at any time, but it’s a good practice to do it while creating a tag.
- If you’re setting up a new trigger, name the trigger.
- In Trigger type, choose a type. For example, Page view.
Tip: Each trigger type is described in this section.
- Click Next.
- Set up additional trigger elements.
- In Event conditions, define conditions for the trigger. For example,
Page URL contains blog
.
Available below 16.0.0
In Audiences, pick an audience for which you want to run the tag. For example, we’ve got an audienceApple product users
and we want to run the tag only for visitors from this audience.
Tip: For more about audiences, read this article.
- In Multiplicity, set how often the tag should be fired. For example, Many times during a session.
- When you’re done, click OK.
- Click Save for the tag.
- Test your tag in debug mode.
- When you’re happy how the tag works, click Publish.
Tip: You can fire tags in a specific order by prioritizing them under Menu > Tag Manager > Settings> Tag priority.