When you need to check if tracking works on your website correctly, you can use three methods: tracker debugger, debug mode in Tag Manager or an inspector tool in the browser.
In this article, we’ll explain how to work with those methods.
Use tracker debugger in Analytics
To check tracking with the tracker debugger, follow these steps:
- Open the website that you track with Piwik PRO.
- Consent to all tracking purposes.
- Right click on any element on the website and click Inspect or Inspect Element, depending on the browser you’re using.
- Navigate to Console.
- In Console, use the following call. It will return the visitor ID that was set for you.
_paq.push([ function() {console.log(this.getVisitorId())}]);
- Copy the visitor ID.
- Log in to Piwik PRO.
- Go to Menu > Analytics.
- Navigate to Settings.
- On the left, click Tracker debugger.
- Paste the visitor ID to the session filter.
- If tracking works correctly, you’ll see your current session with the visitor ID and all performed events.
Use debug mode in Tag Manager
To check tracking in debug mode, follow these steps:
- Go to Menu > Tag Manager.
- From the website picker, choose a website or app you want to work with.
- In the top-right corner, click Debug.
Tip: To open debug mode, you can also add
?_stg_debug
at the end of your website’s URL. - Your website will open in a new tab with debug mode running.
- Check if the container is installed on the page.
- Sync: on or off. It should be on, if you use the container for synchronous tags.
- Async: on. It should be always on. It shows the status of the container for asynchronous tags.
- Check if the tag called
Piwik PRO
was fired.
- Click the tag name to see tag details like HTML tag content, tag type, and trigger.
- If the tag wasn’t fired, check if the trigger is set as
All page views
. You may also need to check trigger’s conditions.
- Additionally, navigate to Events log.
- Find a
stg.pageView
element on the event list and click on it. - Here you’ll see all tags that were fired on page view. If you see the Piwik PRO tag fired, the tracking is working correctly.
Use inspector tool in the browser
To check tracking using an inspector tool in the browser, follow these steps:
- Open your website.
- Right click on any element on the website and click Inspect or Inspect Element, depending on the browser you’re using.
- Navigate to Network.
- Refresh the browser.
- Find the
ppms.php
element on the network list.
Tip: You may see two types of
ppms.php
elements:ppms.php?action-name=
andppms.php?ping=
.Action-name
is a request of page view.Ping
is a request that checks if the visitor’s session is still active. The frequency of the ping is set in Piwik PRO tag settings. - Click
ppms.php
and check the following items:- Status is 200 OK. This means that tracking works correctly.
- Request URL is the name of your account (instance) in Piwik PRO.
- Website ID is the ID that should match the one used in your account (instance) in Piwik PRO.
Tip: To find a website ID in Piwik PRO, follow these guidelines.
- If you need further information, navigate to Console.
- If the tracking is broken, you’ll see an error message in the console.
- In Console, you can also use the following calls:
_paq
: if the call returns_paq.push
tracking is working correctly._paq.push(['trackPageView']);
: if returns undefined tracking is working correctly.
Tip: Using an inspector tool you can also check cookies set by Piwik PRO in your browser. Navigate to Application > Cookies and look for cookies listed here.
Reasons for broken tracking
If you run into a broken tracking on your website, then one of the following issues may cause that:
- Piwik PRO tag, which is responsible for tracking, is disabled.
- Trigger for the Piwik PRO tag is incorrect. It should be set as
All page views
usually with no additional conditions. - Tracking code is not installed on your website properly. For more about installing a tracking code, read this article.