Install a tracking code

Piwik PRO uses a tracking code (a JavaScript code) to collect data about people who visit your site or app. The tracking code is embedded on your web pages and linked to your website set in Piwik PRO. Every time a visitor views a page, the tracking code grabs information about that visitor and sends it to Piwik PRO. Then Piwik PRO organizes this data into reports.

In this article, we’ll show you how to install a tracking code to your website or app.

Before you start

Before you start setting up tracking, here are some basic things you should know:

  • Piwik PRO uses a container that holds a tracking code. The container is used by Piwik PRO Tag Manager to fire custom code on your website. The tracking code is a tag, called Piwik PRO tag, sealed in the container.
  • You can change how the tracking code collects data using options in the Piwik PRO tag in Tag Manager or modify the code via JavaScript API.
  • Piwik PRO uses two types of containers: for asynchronous tags and synchronous tags. Always install the container for asynchronous tags — this code will collect accurate data. If you plan to use tags for A/B tests, install both codes on your website. For more, read this article.
  • Add a website or an app to Piwik PRO.
  • For WordPress sites, you can use a plugin to install the tracking code.

Add a tracking code

Each website or app added to Piwik PRO, has a separate tracking code. But under one website or app, you can track many domains (many websites) and subdomains, and then the tracking code is the same. So as you set up tracking, make sure you’re using the code relevant to the website or app you’re installing it to.

To install a tracking code, follow these steps:

  1. Go to Menu > Administration.
  2. Navigate to Websites & apps.
  3. On the left, pick the website or app that you want to work with.
  4. Navigate to Installation.
  5. Container code for asynchronous tag (required) 

  6. Copy the code by clicking Copy to clipboard.
  7. Container code for asynchronous tag in Piwik PRO.
  8. Paste the code to your website’s source code right after the opening <body> tag. Make sure it’s on all your pages.
  9. Container code for synchronous tag (optional)

  10. Copy the code by clicking Copy to clipboard.
  11. Container code for synchronous tag in Piwik PRO.
  12. Paste the code to your website’s source code inside <head></head> tags. Adding the code elsewhere may slow loading time of your website and break tracking.

If everything is set up correctly, you’ll see data in Analytics in about one hour. Yet, if you want to manually check that tracking is working, follow these guidelines.

Was this article helpful?

Technical Support

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

We’re happy to help!