Custom content tag

Tag Manager

Whenever you want to create a contextual ad on your website, you can use a ready-made tag in Tag Manager, called a custom content. We designed it to help you better manage and display this type of ad.

A contextual ad can be anything from a banner to an info-box. Unlike pop-ups, it appears inside the content of your website. For example, it can be an info-box about the new podcast at the end of your blog post. In this article, we’ll show you how to set it up.

Custom content tag in Tag Manager in Piwik PRO

Before you start

Here are some things to know before you begin working with custom content tags:

  • You need to have basic knowledge of HTML and CSS to design the contextual ad (the content), but setting it up is easy.
  • The custom content tag is set to be displayed for visitors who consent to A/B testing and Personalization, but you can change this setting.
  • A custom content tag loads simultaneously with other tags (It’s an asynchronous tag).
  • You need to tell where the content will be displayed. For that, you need to have a target ID (a div ID) on your website. 

Set up a custom content tag

To set up a custom content tag, follow these steps:

  1. Design and code your contextual ad in HTML.
  2. Go to Menu > Tag Manager.
  3. Navigate to Tags.
  4. Click Add a tag.
  5. Name the tag and choose the following tag type: Custom content.
  6. In HTML tag code, type the code with your contextual ad. 
    Custom content tag in Tag Manager in Piwik PRO
  7. In Content placement, type the target element ID from your website. For example, a div ID of the section where you want to display the contextual ad.
    Content tag in Piwik PRO
  8. In Advanced tag settings, set the tag type. By default, it’s set to be displayed to visitors who consent to A/B Testing and Personalization, but you can change it to a different type.
    Content type in Piwik PRO
  9. 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.
  10. Enable document.write is turned off by default. Toggle this option, if your tag needs document.write.
  11. In Flight dates, set the date and time when the tag is fired.
    Flight dates in Piwik PRO
  12. In Tag triggers, click Add a trigger or Choose existing trigger to set up a trigger for your contextual ad.
  13. If you’re setting up a new trigger, name the trigger.
  14. In Trigger type, choose the trigger type. For example, Page view.
    Custom content tag in Tag Manager in Piwik PRO
  15. Click Next.
  16. In Trigger conditions, define conditions for the trigger. For example, Page URL contains blog.
    Event conditions in Piwik PRO
  17. Available below 16.0.0 In Audiences, pick an audience for which you want to display the contextual ad. For example, we’ve got an audience Apple product users and we want to display the content only for visitors from this audience.
    Custom content tag in Tag Manager in Piwik PRO

    Tip: For more about audiences, read this article.

  18. In Multiplicity, set how often the tag should be fired. For example, Many times during a session.
    Multiplicity in Piwik PRO

    Tip: We advise you to fire the custom content tag multiple times. Otherwise, your contextual ad may appear and disappear after a visitor reloads the page.

  19. When you’re done, click OK.
  20. Click Save for the tag.
  21. Test your tag in debug mode.
  22. When you’re happy with how the tag works, click Publish.

Track content impressions

To start tracking content impressions, follow these steps:

  1. Go to Menu > Tag Manager.
  2. Navigate to Tags.
  3. On the left, click Piwik PRO (tracking code).
  4. In Data collection, turn on Interactions with popups and content.
    Interactions with popus and content in Piwik PRO
  5. After this option is turned on, the tracker will start counting content impressions on your website. All stats will be available under Menu > Analytics > Reports > Content performance.
    Custom content tag in Tag Manager in Piwik PRO

Was this article helpful?

Technical support

If you still have any questions, visit our community.
There’s always someone happy to help!

Related articles

Back to help center