Knowledge Base      


What are tracking pixels and tracking code?


Tracking “pixels” and tracking code relay information about what’s happening on your website back to 3rd-party analytics tools like Google Analytics or ClickMagick, and also to your ad networks like Facebook or Google Ads for example.


What is a Tracking Pixel?

Strictly speaking, a traditional tracking “pixel” is HTML code that displays a single dot on the screen. The pixel is displayed using the HTML “image” tag and looks like this:

<img src="..." height="1" width="1" />

Because a pixel is a display element, it must be inserted in your web page's “body” section.

These type of tracking pixels rely on “third-party cookies” to work, which the industry is moving away from, so modern tracking solutions like ClickMagick do not use these types of tracking pixels.


What is Tracking Code?

Tracking code—used by tools like ClickMagick and Google Analytics—is computer code written in the JavaScript language. It usually begins with a <script> tag and looks something like this:

<script> ...code... </script>

This type of tracking code sets “cookies” on your own domain – known as “first party cookies” – and basically operates as if it’s part of your webpage, so browsers and other apps don’t block or interfere with it.

For the best performance, you’ll want to any ClickMagick Tracking Code in the “head” section of your webpage between the <head> … </head> tags so it loads as quickly as possible …

But you can also put it in the “body” section of your webpage if that’s your only option.

Article 203 Last updated: 04/01/2025 9:59:44 AM
https://www.clickmagick.com/kb/?article=203