Knowledge Base      


How do I add tracking pixels or JavaScript code to WordPress?


This article will show you where to install tracking pixels and tracking codes in WordPress.

But, before you read further, if you don’t already have a good understanding of where to install tracking pixels on an HTML page, the rest of this document will make more sense if you review this article first:
 
What are tracking pixels and tracking code?


That being said, there are two ways you can add a tracking pixel to your pages in WordPress. 


The first way is great if you are familiar with HTML coding and want to add it to the page while editing. 

1. While in the page editor, click on the three dots in the top right and then click “Code Editor”

 


2. From there, add the image tracking pixel above everything else on the page, just like you see below:

 
Note: If you aren’t sure what your image tracking pixel is, you can build one using the ClickMagick Pixel Builder


 


This can seem a little daunting at first, but you're good to go once you have the code in there.

 

The second option – and the easiest of the two – is to install tracking pixels and JavaScript code to WordPress is installing a tracking code plugin such as the popular “Tracking Code Manager.”

With this plugin, you can place tracking pixels or JavaScript codes on any page anywhere without touching the pages themselves.


1. To install the plugin, you first need to click “Plugins” on the left menu in WordPress. 

2. Click “Add New” at the top, and search for “Tracking Code Manager”.

 


3. Install and activate the plugin, and then go to Settings > Tracking Code Manager.

 


4. Click on “Add New Script”. 

Give your script a name, add the tracking code to the box, and choose the correct position (JavaScript Pixel Code goes before </HEAD>Image Tracking Pixel goes after <BODY>)

 


5. Choose the options for this code. For most scenarios, “Standard code tracking” and “In the whole website” are the options you should choose. You have the option of choosing specific pages and even excluding certain pages as well.

 


Article 593 Last updated: 06/13/2023 11:55:58 AM
https://www.clickmagick.com/kb/?article=593