By implementing tracking codes on your website, you can monitor certain aspects of your website visitor’s behavior. There are several providers who can supply you with such tracking codes, the most popular amongst these is Google Analytics, but there are also alternative providers, like Piwik, Kissmetrics, etc. In case you are having issues with your tracking code or if you do not know where and how to place it, then please see this overview on most common issues when implementing tracking codes on your website.
- What is the purpose of tracking codes on your website
- Which tracking codes are compatible with your WordPress theme
- How to implement tracking codes on your website
- Common reasons why tracking codes possibly do not work properly
- You have not found a solution to your issue?
What is the purpose of tracking codes on your website
Tracking codes will provide you with information about the behavior of your website visitors: How many visitors does your site have per day, week, year …? Which countries are your visitors coming from? Which devices are they using? These are only examples of what you could track – of course there are more aspects, depending on your preferences and what your provider offers. Using tracking codes on your website can be helpful to optimize your website in various different ways, but it is not necessarily required to run websites, though recommended to gather valuable information to optimize your website in case you run professional websites for commercial purposes.
Which tracking codes are compatible with your WordPress theme
In general you can use tracking codes from any provider of your choice with our WordPress themes. WordPress themes itself do not affect the tracking code in any way. Tracking codes work as stand-alone tracking scripts and do what they are supposed to, WordPress themes or plugins simply output the code that is necessary to make your tracking work as expected.
How to implement tracking codes on your website
You can insert your tracking code on your website in various different ways. For some of our WordPress themes (e.g. MH Magazine) we have implemented an option to easily insert the tracking code (not tracking ID) via the customizer. Simply navigate to Appearance => Customize => Theme Options => Tracking Code in your WordPress dashboard and copy & paste the tracking code into the provided field. Your WordPress theme will add the tracking code to the footer of your website.
In case you are using WordPress themes which do not offer such options, you can add your tracking code either by using suitable plugins, or by modifying the file footer.php of your WordPress theme within a child theme. We also have created a helpful WordPress tutorial regarding these two approaches for the Google Analytics tracking code – but this of course also applies to any other tracking code from different providers: Two ways to add Google Analytics to WordPress.
Common reasons why tracking codes possibly do not work properly
As mentioned previously, WordPress itself, WordPress themes or WordPress plugins usually do not interfere with tracking codes – they simply output the code as it has been entered by the user. That means if you are having troubles with your tracking code, please check if you have implemented (copy & paste) the correct tracking code without missing digits or else.
Regarding Google Analytics, make sure you have not entered the Google Analytics ID (starts with UA), but the correct tracking code instead. Check for conflicts with plugins and deactivate these one by one if necessary – the same applies to other 3rd party scripts which you might have implemented. If none of that helps, please contact your tracking code provider and ask for assistance.
You have not found a solution to your issue?
In case you have not found answers to your questions in this support article, please also take a look at our other support topics, as it is very likely that you will find your answer there. If you have purchased a WordPress theme by MH Themes and have a valid license to gain access to theme updates and support, then you may also send a support request for additional assistance.