Tags

A tag is a snippet of a JavaScript code that sends information to a third party. Thanks to Piwik Pro Tag Manager, you don’t need to add tags directly to your website, you just need to specify how and when the tag should fire. Only keep in mind the tag won’t fire without an assigned trigger.

To add a tag, follow these steps:

  1. Go to Menu > Tag Manager.
  2. Click a Create new tag button
  3. Create a new tag
  4. Name the tag and choose a tag type template.
  5. Name a tag

    You can choose from two types of tags:.

    • Asynchronous tags — load at the same time as the page’s content. Tags may fire after loading the page’s content. It’s a good practice to use asynchronous tags for tracking tags.
    • Synchronous tags fire and load first — even before the page loads. The content of a page won’t appear until the tag fires. It’s a good practice to use synchronous tags for A/B tests.

    In both sections, you can choose one of tag templates or a custom tag template. For a custom tag template, you will have to paste the tag’s snippet code into the tag section. The HTML editor has embedded linter and syntax which helps you to debug your JavaScript code. The HTML editor allows you to use Variables, both basic and custom. Just click one of the variables on the right to insert it into your code.

    Custom tag
  6. For a custom tag template, you can enable the document.write option if the tag needs the document.write feature.
  7. Enable document write
  8. In Advanced tag settings, choose a tag type.
  9. Advanced tag type

    This setup allows you to choose when to fire a tag. Any tag type other than Does not require consent will require visitor consent to fire.

  10. Set an option to respect your visitor privacy.
  11. Rescpect visitor privacy

    Pick this option if you want to respect privacy of your visitors, who decided to:

    • Set up the Do Not Track option in their web browser.
    • Opted out from being tracked.
  12. Set not to fire a tag in the debug mode, if you don’t wish this tag to fire when debugging.
  13. Don't fire a tag in a debug mode

    Once the tag is published it will fire for visitors, but it will not fire in the debug mode. In the debug mode you will see a tag marked as disabled. Keep it in mind while testing all of your tags.

    Disabled tag in a debug mode
  14. Add one or more triggers to a tag.
  15. You can add a trigger to a tag anytime, but it’s a good practice to do it while creating a tag.

    Add a trigger to a tag

Setting tag priority

By default, tags fire in an order defined by the edit date. And they always fire fired asynchronously. But if you want to fire tags in a specific order, you can arrange it by setting a priority for them.

To set priority for tags, follow these steps:

  1. Sort the list of tags by priority
  2. Sort tags by priority
  3. Drag and drop tags to set expected order.
  4. Drag a tag to set a priority
  5. Publish your changes to make it live.

Scheduling flight dates

You can schedule when your tags will be live. You can set up two options that can work side by side:

  • Date range — you can select a period when the tag will be live. For example, fire a tag with a pop-up only between 1st and 3rd May. The tag won’t be fired before 1st and after 3rd of May, even if triggers conditions will be met.
  • Flight dates for tag days
  • Time of day — you can pick hours during a day when the tag will be live. For example, display a tag with a pop-up only between 8 a.m. till 8 p.m. The tag won’t be fired before 8 a.m. and after 8 p.m., even if triggers conditions will be met.
Flight dates for tag hours

Dates and hours base on your website’s server time. Yet, you can choose a timezone for flight dates.

Time zone for flight dates

Creating a trigger

When creating or editing a tag, you can also add one or more triggers to it, and it’s a good practice to do it at this step.

To add a trigger to a tag, follow these steps:

  1. Click a New trigger button.
  2. Name the trigger.
  3. Chose a trigger type and conditions. For more informations go to the Trigger section. Just keep in mind, synchronous tags are compatible only with the page view trigger. You are not able to fire synchronous tags with the following triggers: click, sending form, event, page scroll, leave content, and time on website.
  4. Adding a trigger for a tag
  5. Click the Save button for a trigger.
  6. Save a trigger
  7. Add more triggers if you want to, and when done click Save button for a tag.
Save a tag

Choosing an existing trigger

If you want to pick a trigger you’ve already created, select an existing trigger when adding a trigger to a tag.

To choose an existing trigger for a tag, follow these steps:

  1. Click an Existing trigger button.
  2. Choose one or more triggers from the list and click the OK button.
  3. Adding an existing trigger to a tag
  4. Click a Save button for a trigger.
  5. Save a trigger for a tag
Was this article helpful?

of people found this helpful

Technical Support

If you have any questions, drop us a line at support_SPC@piwik_SPC.pro.

We’re happy to help!