What is the Pixel/Code field of a tracking link used for?
The Pixel/Code field of a tracking link allows you to fire tracking pixels or execute JavaScript code in situations where you can’t insert pixels or JavaScript code on the page that the tracking link redirects to.
This would probably be clearer with an example ...
Suppose you have an opt-in page that leads directly to the offer page of an affiliate network. Normally, you would put an action pixel on the page after the email opt-in to record that the opt-in happened. But in this example, you can’t put a pixel on the sales page of the affiliate network because you don’t control that page and can’t edit it.
This is a perfect use for the Pixel/Code field. Instead of firing the pixel once you land on the destination page, you would fire the pixel while the link is redirecting to the destination page.
To set this up, you would use a tracking link as the Thank You page URL from your opt-in page. You would then set up the tracking link to point to the sales page of the affiliate offer and you would insert your pixel or JavaScript code into the Pixel/Code field of the tracking link.
With this setup, when the opt-in page redirects through the tracking link to the sales page of the affiliate offer, the pixels will fire and the JavaScript code will execute.
You can often use this technique when you need to fire a pixel or execute a piece of JavaScript code but cannot edit the page where you would normally insert them. If you can point a tracking link at the page, you can set everything up using the Pixel/Code field of the tracking link.
Just follow these steps:

1. |  | Create a new tracking link and set the Primary URL to the destination page.

2. |  | If you’re trying to fire a ClickMagick tracking pixel, create a new tracking pixel using the Pixel Builder. Make sure that you select “Last Click” for “Conversion Attribution” and select Yes for the question “Are you adding this pixel to a tracking link?” These two settings must be correct or things won’t work as expected. After you’ve made your other selections for the new pixel, copy the generated “Image/HTML” pixel from the bottom of the page.

3. |  | Open the Advanced Settings of the new tracking link and paste your new ClickMagick pixel, Facebook pixel, retargeting pixel, tracking code, etc., into the Pixel/Code section. It’s perfectly okay to paste more than one pixel or piece of tracking code into the Pixel/Code section. Just be sure to cut and paste them carefully. If you mess this up it can cause your tracking link to malfunction.

4. |  | Save the tracking link.

You can now direct clicks to the tracking link which will first fire all the pixels and tracking code in the Pixel/Code setting and will then redirect to the original destination page in your Primary URL. Nice and clean!
You can also check out these videos that show exactly how to set up a tracking or retargeting pixel for a page you can’t edit:

|  | Add a Tracking Pixel Using a Tracking Link

|  | Add a Retargeting Pixel Using a Tracking Link

Caution: Tracking pixels will only fire if the click is sent to your Primary URL or to a split test URL. Pixels will NOT fire if the click is sent to your Backup URL, or any other re-routed URL.
Note: If you need to pass a click ID through the tracking link, simply pass the click ID as the first Sub-ID to the tracking link and then add the `s1=[s1]` query string parameter to your Primary URL. ClickMagick will automatically replace the `[s1]` token in your Primary URL with the first sub-ID that you passed to the tracking link (your click ID). For more information on how to pass click IDs to tracking links, see this FAQ:

|  | How to pass Click IDs through a Tracking Link