Set up content tracking

Content tracking lets you collect data about impressions and interactions with elements on your website. For example, you can track a visitor who sees a banner and clicks the button on it. 

To set up content tracking, you need to turn the content tracking option in Piwik PRO’s settings and tag the element on your website. Once you finish the setup, the collected data will appear in the content performance report.

In this article, we’ll show you how to adjust content tracking correctly.

Before you start

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

  • By default, content tracking works for a custom pop-up tag and a custom content tag.
  • To tag an element on your website, you need to have access to your website’s code. You could also tag an element using Tag Manager, but this is a more complicated method.

Definitions and metrics in content tracking

Before you code your website and adjust settings in Piwik PRO, you should understand the definitions and metrics used for content tracking:

  • Content block: An element on your website that consists of a content name, piece, and target.
  • Content name: A name of the tracked content block. The name will show up in the report. You can use one name for many content pieces.
  • Content piece: A piece of the tracked content block, for example, a creative, banner, or video. The piece will show up in the report.
  • Content target: A target of the tracked content block, for example, a link in the content block. The target will show up in the report.
  • Content impressions: The number of times a content block was displayed to visitors.
  • Content interactions: The number of times visitors interacted with a content block, for example, clicked an element in a content block.
  • Content interaction rate: A percentage that tells you how many people interacted with a content block. Content interaction rate = Content interactions / Content impressions * 100%

Turn on content tracking

To start, you need to enable content tracking in the Piwik PRO tag, which is responsible for collecting data on your website.

To turn on content tracking, follow these steps:

  1. Go to Menu > Tag Manager.
  2. Navigate to Tags.
  3. From the left-hand list, select Piwik PRO
  4. In Piwik PRO Analytics setup, toggle Enable content tracking.
  5. Enable content tracking in Piwik PRO.
  6. Select if you want to track All content impressions or All visible content impressions.
  7. The difference between those two options is:

    • All content impressions: The tracker counts an impression after a page with content loads, no matter if it is visible or not.
    • All visible content impressions: The tracker records an impression if the content becomes visible for a visitor, for example, when a visitor scrolls down and sees a banner.
  8. When you’re done, click Save for the tag.
  9. Click Publish to make changes live.

Tag an element on your website

Next, you need to add a piece of code to an element on your website that you want to track. Let’s take an example from the Clear Bank website where we have a banner with a newsletter signup. We want to know the number of people who viewed the banner and the number of people who clicked a button on the banner. To collect this data, we will need to tag the banner.

To tag an element, you can use the following attributes or CSS classes:

  • [data-track-content] or .piwikTrackContent: Define a content block.
  • [data-content-name=""]: Defines the name of the content block.
  • [data-content-piece=""] or .piwikContentPiece: Define the content piece.
  • [data-content-target=""] or .piwikContentTarget: Define the content target.

To tag an element, follow these steps:

  1. Find the element on your website that you want to track. For example, a div class of the banner.
  2. Add a piwikTrackContent class or a data-track-content attribute to HTML. For example:
  3. Add a class:

    <div class="et_pb_column et_pb_column_4_4 et_pb_column_16 et_pb_css_mix_blend_mode_passthrough et-last-child piwikTrackContent">

    or
    Add an attribute:

    <div class="et_pb_column et_pb_column_4_4 et_pb_column_16 et_pb_css_mix_blend_mode_passthrough et-last-child" data-track-content>
  4. Add a content name, piece, and target to HTML. You can add only a name. For example:

Add a class:

<button type="submit" class="et_pb_contact_submit et_pb_button piwikContentPiece" >Subscribe</button>

or
Add an attribute:

<button type="submit" class="et_pb_contact_submit et_pb_button" data-content-piece="subscribeButton">Subscribe</button>

Content performance report

After enabling content tracking and tagging elements on your site, the tracker will start collecting data. The data will appear in the content performance report.

To view the content performance report, follow these steps:

  1. Go to Menu > Analytics (new).
  2. Navigate to Reports.
  3. On the left, click Content performance.
  4. View the report.

Tip: In Analytics (classic), the similar report is called the content report (Menu > Analytics > Actions > Contents).

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!