In this article, we’ll show you how to install a tracking code to your website or app.
Before you start setting up tracking, here are some basic things you should know:
- First, add a website or an app to Piwik PRO.
Note: Before you install the code, you can set up data collection under Administration > Websites & apps > Settings.
- You always need to install the basic container (async) because it holds your tracking code and is used to handle most tags. You can also install the additional container (sync) if you want to use sync tags.
- For WordPress sites, you can use a plugin to install the container (with the 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:
- Go to Menu > Administration.
- Navigate to Websites & apps.
- On the left, pick the website or app that you want to work with.
- Navigate to Installation.
- In Basic container (async), click Copy to clipboard.
Note: This container holds your tracking code and is used to handle most tags.
- Paste the code right after the opening <body> tag on every page of your website or app.
- Data will appear in reports in about an hour. Data in the tracker debugger will appear instantly.
Tip: You can also check manually if the tracking works. Read more
- Optionally, in Additional container (sync), click Copy to clipboard.
Note: Add this container if you want to use sync tags. It loads tags before the page content loads.
- Paste the code inside <head></head> tags on your website or app. Don’t add this code elsewhere because it may slow down your site and tracking won’t work correctly.
- You can start adding sync tags right away.