This article details how to install the Infinity tracking script on WordPress sites using third-party plugins
This article assumes you have administrator permissions on a website managed through a self-hosted WordPress.org install, as opposed to a WordPress.com managed blog.
This article recommends the use of third-party plugins to easily install the Infinity tracking script within WordPress, and whilst the utmost care has been taken to check the credibility of these plugins, as with the nature of third party tools, Infinity cannot accept any liability for any security issues that may arise through their use.
At no point during this guide should you edit the core WordPress files of your install. This may have adverse effects, and will greatly complicate troubleshooting should anything go wrong in the future.
The fastest and most efficient way to install Infinity’s tracking script within the pages of your WordPress site is to use a tag manager plugin. Using a tag manager enables your WordPress administrators to take control over the tags they deploy within your site and crucially, avoids manipulating any of the core WordPress files or manually inserting the tag into each individual page.
Furthermore, by using a Google Tag Manager plugin specifically, you’ll not only be able to quickly generate Infinity’s tracking script, but also gain access to the Google Tag Manager library, which supports hundreds of analytics and technology apps natively.
You’ll need to have set up a published Google Tag Manager container, and have your Container ID to hand. Further information and instructions on setting up GTM with Infinity can be found here.
For the guide, we’ll be installing and using DuracellTomi's Google Tag Manager for WordPress plugin.
At the time of writing (24th January, 2019), this is the highest rated Google Tag Manager plugin on the market with over 200,000 active installations. Care should be taken to ensure it’s the best fit for your use case, and that you meet the minimum requirements (such as PHP 5.6 or higher.)
To install this plugin, log in to your WordPress administrator dashboard (usually location at yourdomain.com/wp-admin).
Navigate to Plugins.
At the top of the page, click Add New.
In the search field at the top right of the Plugins list, search for “DuracellTomi”.
When the search finishes, click on the DuracellTomi's Google Tag Manager for WordPress result.
Read through the plugin details to ensure your WordPress install meets the requirements.
When you’re ready, press Install Now.
When WordPress has finished installing the plugin, Activate the plugin.
If you’re unable to use the WordPress auto-install feature, head over to the plugin’s listing and download the plugin ZIP.
Upload duracelltomi-google-tag-manager-for-wordpress to the /wp-content/plugins/ directory of your site.
Activate the plugin through the ‘Plugins’ menu in WordPress.
Now that the plugin is installed, navigate to Settings and then Google Tag Manager.
Within the General page, enter your Container ID into the Google Tag Manager ID field and hit Save Changes.
With your changes saved, head over to your website’s front end. By inspecting the source code, you should now see Google Tag Manager being generated within the section of each page.
With the Infinity tacking script in place, Infinity will now be tracking visitor events on every page of your WordPress website, and sending them in for reporting within the Hub.
If you also wish to add dynamic numbers to your site, you’ll need to edit your theme’s templates to add the InfinityNumber classes. Further information and instructions on using Auto Discovery and adding number replacement classes can be found here.
As every WordPress is unique, we can’t offer specific guidance for editing your theme’s template files, so you’ll need to speak to your development team about this.
If you're using WordPress behind a bespoke single page application, you'll need to configure GTM to trigger on specific events (such as navigation items being clicked or a custom JS event occurring), in order to emulate pageviews. You’ll need to speak to your development team about this. Custom Triggers may be of use for tracking custom events.
Please login to rate this article