What pixel types can I use?
In this article you may find what pixel types you can use along with some useful examples.
Pixel types
1. Inline Iframe URL
Description: This type fires the URL pixels in Iframe in Body.
Example: http://test.com/thankyou
Will be fired as <iframe src="http://test.com/thankyou"></iframe> .
Usage: When you need to setup Pixel in shape of URL.
2. Inline Iframe URL Sandboxed
Description: Does the same as Inline Iframe URL but adds a sandbox to cover the original firing place. Was created for specific cases.
Note: Always consult with your senior before using this type.
3. Inline Img URL
Description: This type fires image URLs in Body.
Example: http://test.com/pixel.png
Will be fired as <img src="http://test.com/pixel.png"></img> .
Usage: When setting up a Pixel in the shape of an Image URL.
4. Inline Script URL
Description: This type fires JS Pixels in the form of URL in Head.
Example: http://test.com/javascript-script.js
Will be fired as <script src="http://test.com/javascript-script.js"></script>.
Usage: When setting up a JS code Pixel in the form of URL.
5. Iframe External Content
Description: Fires an HTML code pixel in Body.
Example:
htmlCopy code <script>alert(1)</script> <img src="1.png"></img>
Will be fired as <iframe src="http://crm-url/script/1099"></iframe> .
Usage: When setting up an HTML Pixel in Iframe shape.
6. Iframe External Content Sandboxed
Description: Similar to Iframe External Content but adds a sandbox to cover the original firing place. Made for specific cases.
Note: Always consult with your senior before using this type.
7. Script External Content
Description: Fires JS code Pixels in Head.
Example: alert(1)
Will be fired as <script src="http://crm-url/script/1099"></script> .
Usage: When setting up a JS code Pixel.
8. Body HTML Insert
Description: Fires any kind of pixels by inserting them as HTML code inside Body.
Note: Use if other types haven't worked. Doesn’t require any specific adjustments to the pixel code.
9. Script Evaluate
Description: Fires similar to Script External Content. Doesn’t place the pixel anywhere on the page, fires it through JS command.
Features: Allows viewing the response of the receiving server. Requires adjustments to pixel code.
Note: Rare use-cases; always consult with your senior.
Firing Strategies
1. State Enter
Description: Pixel fires as soon as the state switches for the lead.
On Funnel: OnStateEnter request inside Network section.
Usage: When setting up a pixel on Click Landed or other states apart from Lead Pushed.
2. Handler
Description: Pixel fires when a modal window on successful registration appears.
On Funnel: ?handler request inside Network section.
Usage: When setting up a Pixel on Pushed Lead.
Use Cases
GTAG Pixel
The following Google Tag Manager code can be transformed into two different pixels:
htmlCopy code
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TH6XHL4"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TH6XHL4');
First Pixel
PQL: True
Firing Strategy: StateEnter
Type: Body HTML Insert
Content:
htmlCopy code <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TH6XHL4" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) -->
Second Pixel
PQL: True
Firing Strategy: StateEnter
Type: Evaluate
Content:
jsCopy code (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TH6XHL4');
Facebook Pixel
The original Facebook Pixel code can be dissected into two different sections as follows:
!function (f, b, e, v, n, t, s) {
if (f.fbq) return;
n = f.fbq = function () {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq) f._fbq = n;
n.push = n;
n.loaded = !0;
n.version = '2.0';
n.queue = [];
t = b.createElement(e);
t.async = !0;
t.src = v;
s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window, document, 'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{tp_aff_sub4}');
fbq('track', 'PageView');
fbq('track', 'Lead');
This code is responsible for two different tracking activities: the first part for tracking clicks, and the second – for tracking leads.
First Pixel – Clicks Tracking
PQL: Click Landed
Firing Strategy: StateEnter
Type: Evaluate
Content:
!function (f, b, e, v, n, t, s) {
if (f.fbq) return;
n = f.fbq = function () {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq) f._fbq = n;
n.push = n;
n.loaded = !0;
n.version = '2.0';
n.queue = [];
t = b.createElement(e);
t.async = !0;
t.src = v;
s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window, document, 'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{tp_aff_sub4}');
fbq('track', 'PageView');
Second Pixel – Leads Tracking
PQL: Pushed Lead
Firing Strategy: Handler
Type: Evaluate
Content:
fbq('track', 'Lead');