Go Back

Debugging tracking

May 30, 2018

There are a few methods to check why your tracking is not working properly. Let’s take a closer look at them:

Inspect (developer tools)

Once you right click on your website and pick Inspect (or developer tools), you will be presented with a few developer tools to check what is going on your website:

  • Console – in Console tab it’s visible if there are any errors on your website. Please refresh the page to have the most recent information here (for example if you can see an error code 400 bad request – something is in the wrong place). You can also call different Piwik PRO JavaScript methods here.

    E.g. you can display “_paq” JavaScript variable here. If when writing this the console will hint you with “_paq.push” it means that the tracking code was fired on the website. You can also try to call “_paq.push([‘trackPageView’]);”

  • Network – at the very bottom it will be visible if the “_paq” worked and tracking code was fired. Look for piwik.php or ppms.php requests. If they are present, it means that the tracking code is working properly. This request should always return code 200 (which means that it’s working perfectly).

    We should look through all of the request’s parameters, check the instance name (it should be the same as the address of your instance). Action name, after “=”. provides you an information what kind of action was performed.

    Id site will provide you a number (and with help of this number you can find out if you are tracking correct website). To compare it with the real site ID in Piwik PRO – go to Website and check it right under the name of the website.

  • Application – here you can check the cookies, those with names starting with “_pk” will be the Piwik PRO Marketing Suite ones, and those Tag Manager’s – “stg”. Here we can also clear the cookies.
  • Debug tool – it can be opened by adding “/?stg_debug” to the end of URL you are displaying. You can check there Piwik PRO code, Tag code, its trigger and its conditions.
  • Events log lets you get to know what is actually happening in each moment of working on the website (e.g. _stg_click for the click event). Every one of these events has its own variables and its values and we can check the value of a given variable in the moment of firing a given event.

    Breakpoints let you test your tags without causing the page reload or page redirect. It’s very useful when you want to see what is going on when you click the button that normally redirects to a different page.

    You can learn more about debugging tool here.