Skip to main content

tvScientific Pixels Overview

An overview of the tracking pixels we offer and the required and recommended variables you need to pass for each tracking event.

Updated over a year ago

tvScientific requires the installation of the universal site pixel and your chosen conversion event pixels for the most comprehensive reporting within the platform. These can be installed via a tag manager or directly on your website.

tvScientific Pixel Types


Universal Site Pixel

The universal site pixel tracks page loads (page visits) and should fire on all pages of your website.

Pixel Script Tag

<script type="text/javascript">(function () {var p, s, d, w;d = document;w = window.location;p = d.createElement("IMG");s = w.protocol + "//tvspix.com/t.png?&t=" + (new Date).getTime() + "&l=<TVSCI ID HERE>&u3=" + encodeURIComponent(w.href);p.setAttribute("src", s);p.setAttribute("height", "0");p.setAttribute("width", "0");p.setAttribute("alt", "");p.style.setProperty("display", "none");p.style.setProperty("position", "absolute");p.style.setProperty("visibility","hidden");d.body.appendChild(p);})();</script>


Complete Purchase Pixel

The purchase pixel tracks complete purchase events and should fire on the thank you page after a successful purchase event.

Pixel Script Tag

<script>
(function (j) {
var l='<TVSCI ID HERE>', s, d, w, e = encodeURIComponent, d = document, w = window.location, p = d.createElement("IMG");
s = w.protocol + '//tvspix.com/t.png?t=' + (new Date()).getTime() + '&l=' + l + '&u3=' + e(w.href) + '&u1=complete_purchase&u2=' + j.orderAmount + '&u4=' + e(j.orderId) + '&u5=' + e(j.lastTouchChannel) + '&u6=' + e(j.customerId) + '&u8=' + e(j.customerStatus || '') + '&u12=' + e(j.note) + '&u13=' + e(JSON.stringify(j.items)) + '&u14=' + e(j.promoCode) + '&u15=' + (j.currency || '');
p.setAttribute("src", s); p.setAttribute("height", "0"); p.setAttribute("width", "0"); p.setAttribute("alt", ""); p.style.display = 'none'; p.style.position = 'fixed'; d.body.appendChild(p);
})({
orderId: "{{OrderId}}", //required
orderAmount: "{{Amount}}", //required, pretax, preshipping, postdiscount
currency: "USD", //3 letter currency code
customerId: "{{CustomerId}}",
customerStatus: "{{CustomerStatus}}",
promoCode: "{{PromoCode}}",
note: "{{Note}}",
lastTouchChannel: "{{Last Touch Channel}}",
items: [
{
"SKU": "{{ITEM SKU 1}}",
"CAT": "{{TEM CATEGORY 1}}",
"PR": {{ITEM PRICE 1, POST DISCOUNT}}, // 1090.99
"QTY": {{QUANTITY 1}} // Integer
},
{
"SKU": "{{ITEM SKU 2}}",
"CAT": "{{ITEM CATEGORY2 }}",
"PR": {{ITEM PRICE 2, POST DISCOUNT}},
"QTY": {{QUANTITY 2}}
}
],
})
</script>

Dynamic Parameters

  • OrderId

  • Amount

Optional Parameters

  • CustomerId

  • CustomerStatus

  • Note

  • Items

  • PromoCode

  • LastTouchChannel


Complete Registration Pixel

The registration pixel tracks registration and lead events and should fire on the confirmation page after a successful registration event.

Pixel Script Tag

<script>
(function (j) {
var l='<TVSCI ID HERE>', s, d, w, e = encodeURIComponent, d = document, w = window.location, p = d.createElement("IMG");
s = w.protocol + '//tvspix.com/t.png?t=' + (new Date()).getTime() + '&l=' + l + '&u3=' + e(w.href) + '&u1=complete_registration&u4=' + e(j.orderId) + '&u5=' + e(j.lastTouchChannel) + '&u6=' + e(j.customerId) + '&u12=' + e(j.note);
p.setAttribute("src", s); p.setAttribute("height", "0"); p.setAttribute("width", "0"); p.setAttribute("alt", ""); p.style.display = 'none'; p.style.position = 'fixed'; d.body.appendChild(p);
})({
orderId: "{{Registration Id}}", //required
customerId: "{{CustomerId}}", //optional
note: "{{Note}}", //optional
lastTouchChannel: "{{Last Touch Channel}}" //optional
})
</script>

Dynamic Parameters

  • Registration ID

Optional Parameters

  • CustomerId

  • Note

  • LastTouchChannel


Lead Generated Pixel

The lead-generated pixel tracks lead events and should fire on the confirmation page after a successful lead event.

Pixel Script Tag

<script>
(function (j) {
var l='<TVSCI ID HERE>', s, d, w, e = encodeURIComponent, d = document, w = window.location, p = d.createElement("IMG");
s = w.protocol + '//tvspix.com/t.png?t=' + (new Date()).getTime() + '&l=' + l + '&u3=' + e(w.href) + '&u1=lead_generated&u4=' + e(j.orderId) + '&u5=' + e(j.lastTouchChannel) + '&u6=' + e(j.customerId) + '&u12=' + e(j.note);
p.setAttribute("src", s); p.setAttribute("height", "0"); p.setAttribute("width", "0"); p.setAttribute("alt", ""); p.style.display = 'none'; p.style.position = 'fixed'; d.body.appendChild(p);
})({
orderId: "{{Lead Id}}", //required
customerId: "{{CustomerId}}", //optional
note: "{{Note}}", //optional
lastTouchChannel: "{{Last Touch Channel}}", //optional
})
</script>

Dynamic Parameters

  • Lead ID

Optional Parameters

  • CustomerId

  • Note

  • LastTouchChannel


Viewed Product Pixel

The viewed product pixel should fire on product pages.

Pixel Script Tag

<script>
(function (j) {
var l='<TVSCI ID HERE>', s, d, w, e = encodeURIComponent, d = document, w = window.location, p = d.createElement("IMG");
s = w.protocol + '//tvspix.com/t.png?t=' + (new Date()).getTime() + '&l=' + l + '&u3=' + e(w.href) + '&u1=viewed_product&u4=' + (new Date()).getTime() + '&u5=' + e(j.lastTouchChannel) + '&u12=' + e(j.note);
p.setAttribute("src", s); p.setAttribute("height", "0"); p.setAttribute("width", "0"); p.setAttribute("alt", ""); p.style.display = 'none'; p.style.position = 'fixed'; d.body.appendChild(p);
})({
lastTouchChannel: "{{Last Touch Channel}}", //optional
note: "{{Product Name}}", //optional
})
</script>

Dynamic Parameters

  • Product Name

  • LastTouchChannel


Start Checkout Pixel

The start checkout pixel should fire on the start checkout page.

Pixel Script Tag

<script>
(function (j) {
var l='<TVSCI ID HERE>', s, d, w, e = encodeURIComponent, d = document, w = window.location, p = d.createElement("IMG");
s = w.protocol + '//tvspix.com/t.png?t=' + (new Date()).getTime() + '&l=' + l + '&u3=' + e(w.href) + '&u1=start_checkout&u4=' + (new Date()).getTime() + '&u5=' + e(j.lastTouchChannel);
p.setAttribute("src", s); p.setAttribute("height", "0"); p.setAttribute("width", "0"); p.setAttribute("alt", ""); p.style.display = 'none'; p.style.position = 'fixed'; d.body.appendChild(p);
})({
lastTouchChannel: "{{Last Touch Channel}}", //optional
})
</script>

Dynamic Parameters

  • LastTouchChannel


Add to Cart Pixel

The add to cart pixel should fire on the add to cart page.

Pixel Script Tag

<script>
(function (j) {
var l='<TVSCI ID HERE>', s, d, w, e = encodeURIComponent, d = document, w = window.location, p = d.createElement("IMG");
s = w.protocol + '//tvspix.com/t.png?t=' + (new Date()).getTime() + '&l=' + l + '&u3=' + e(w.href) + '&u1=add_to_cart&u4=' + (new Date()).getTime() + '&u5=' + e(j.lastTouchChannel);
p.setAttribute("src", s); p.setAttribute("height", "0"); p.setAttribute("width", "0"); p.setAttribute("alt", ""); p.style.display = 'none'; p.style.position = 'fixed'; d.body.appendChild(p);
})({
lastTouchChannel: "{{Last Touch Channel}}", //optional
})
</script>

Dynamic Parameters

  • LastTouchChannel


Pixel Dynamic Values

Parameters should be passed from your site using dynamic variables when a conversion occurs. If you're unable to pass the optional parameters in the pixel, pass an empty string if unavailable (example below).

note: "",
lastTouchChannel: "",

Parameter

Description

Example

Required

Amount

subtotal of the transaction (pre-tax, pre-shipping, post-discount). decimal 8.2

9.99

For purchase events

EventId

OrderId

RegistrationId

LeadId

Unique event identifier your platform assigns to events/orders. Used to dedupe events.

8765680

Yes

Last Touch Channel

The last channel user interacted with when landed on the website. Pass an empty string if unavailable.

Paid search

No

CustomerId

Unique customer identifier your platform assigns to customer accounts. Do not use personally identifiable data for this field.

1234245769

No

CustomerStatus

Submit values of either New or Existing. Can be configured to alter payouts.

New

No

Note

Custom notes pertaining to the event

Special Note

No

Items

Item level data array, mapped with the following parameters: SKU (SKU), CAT (Category), QTY (Quantity), PR (Single Item Amount, post discount, pre-tax)

No

PromoCode

A promotional code applied to the order.

If multiple codes are used, include only one.

TVCODE

No

Currency

Three-letter ISO 4217 code for the currency of your platform.

USD

No


Example item level data array

Items Array

items: [
{
"SKU": "LEGO-STAR_WARS_MAN1",
"CAT": "Toys",
"PR": 8.99,
"QTY": 4
},
{
"SKU": "YELLOW_CHAIR-10",
"CAT": "FURNITURE",
"PR": 1000.99,
"QTY": 1
}
],

Did this answer your question?