Skip to main content

tvScientific Pixels Overview

An outline of the tracking pixels available through tvScientific, including the required and recommended parameters for each event type.

Updated over 2 months ago

For the most complete reporting experience in the platform, we recommend implementing the Universal Site Pixel, Visited Site Pixel, and any relevant event-specific pixels. These can be added either through a tag manager or directly to your website's code.


Universal Site Pixel (USP)

The Universal Site Pixel (USP) must be the first script that loads on your website prior to triggering any event-related functions. To ensure consistent tracking, place it in the global <head> section so it loads on every page. This pixel is required for all tracking to function properly.

Using a Tag Manager? Add the USP as a Custom HTML tag and set it to trigger on All Pages.

<script src="https://assets.tvscipixel.com/<TVSCI PIXEL ID HERE>.js"></script>

Visited Website Pixel

The Visited Website Pixel captures page view activity. It should be placed within the <body> of every page, loading after the Universal Site Pixel (USP) and as early as possible in the page load to ensure accurate tracking. This pixel fires once per session.

Using a Tag Manager? Add the Visited Website tag as a Custom HTML tag and configure it to trigger only after the USP has successfully loaded. In Google Tag Manager, use the Tag Sequencing feature to enforce this order.

If you're using GA4, ensure this pixel also fires after the GA4 tag. You can manage this dependency with Tag Sequencing in GTM as well.

Pixel Script Tag

<script>tvsci.fireUniversalSitePixel()</script>

Complete Purchase Pixel

The Complete Purchase Pixel tracks completed transactions and should be invoked on the "Thank You" page following a successful purchase.

Copy the provided code snippet and replace any placeholders wrapped in {{double curly brackets}} with your dynamic variables. If a value is optional, you may remove that entire line from the code.

Place the finalized snippet within the <body> of the purchase confirmation page, or embed it in the appropriate HTML element if it's triggered inline.

Using a Tag Manager? Add the Complete Purchase Pixel as a Custom HTML tag and configure it to trigger after the Universal Site Pixel (USP). In Google Tag Manager, use Tag Sequencing to ensure it only fires once the USP has loaded successfully.

Pixel Script Tag

<script>
tvsci.fireCompletePurchasePixel({
orderId: "{{OrderId}}", //REQUIRED
orderAmount: {{Amount, without currency symbol}}, //REQUIRED
lastTouchChannel: "{{LastTouch_channel}}", //OPTIONAL
customerId: "{{CustomerId}}", //OPTIONAL
customerStatus: "{{Customer_Status}}", //OPTIONAL
note: "{{Note}}", //OPTIONAL
promoCode: "{{Promo_code}}", //OPTIONAL
currency: "USD" //OPTIONAL
items: [{{Items Array}] //OPTIONAL
});
</script>

You may remove any optional lines if you don’t intend to pass those values.

Example pixel with sample values filled in:

<script>
tvsci.fireCompletePurchasePixel({
orderId: "#12345",
orderAmount: 1.99,
lastTouchChannel: "Paid_Search",
customerId: "67890",
customerStatus: "NEW",
note: "Gold Membre",
items: [{"SKU": "LEGO-STAR_WARS","CAT":"Toys","PR":8.99,"QTY":4}, {"SKU":"YELLOW_CHAIR", "CAT":"FURNITURE", "PR":11.99, "QTY":1}],
promoCode: "DISCOUNT10",
currency: "USD"
});
</script>


Complete Purchase Pixel With Auto Generated order Id

The Pixel is designed to track completed purchase events and should fire on the thank-you page following a successful transaction.

This pixel will automatically generate an Order ID, making it especially useful when access to the website’s data layer is limited. If you manually include an Order ID in the pixel script, it will be overwritten by the auto-generated one. Please note: the automatically generated Order ID will remain the same throughout the browser session and will be re-used if the pixel is triggered again.

Copy the code snippet and replace the values inside the {{double curly brackets}} with your dynamic variables, or remove any optional lines that are not needed.

Place the customized script within the <body> of the confirmation page or attach it to the appropriate HTML element for inline actions.

Using a Tag Manager? Add the Purchase Pixel as a Custom HTML tag and configure it to trigger after the Universal Site Pixel (USP). In Google Tag Manager, use Tag Sequencing to ensure it only fires once the USP has loaded successfully.

Pixel Script Tag

<script>
tvsci.fireCompletePurchasePixelWithAutoOrderId({
orderAmount: {{Amount, without currency symbol}}, //REQUIRED
lastTouchChannel: "{{LastTouch_channel}}", //OPTIONAL
customerId: "{{CustomerId}}", //OPTIONAL
customerStatus: "{{Customer_Status}}", //OPTIONAL
note: "{{Note}}", //OPTIONAL
promoCode: "{{Promo_code}}",//OPTIONAL
currency: "USD" //OPTIONAL
items: [{{Items Array}] //OPTIONAL
});
</script>

You can remove the lines marked optional if you do not plan to pass these values. You can hardcode the amount if you cannot dynamically populate it.

Example pixel with amount value filled in:

<script>
tvsci.fireCompletePurchasePixel({
orderAmount: 0.01 });
</script>

Custom Event Pixel

The Custom Event Pixel is used to track specific user actions and should fire after a successful event has occurred. Replace [[Your_Event_Name_Here]] with one of the following supported event names:

  • lead_generated

  • add_to_cart

  • complete_registration

  • start_checkout

  • trial_started

  • viewed_product

  • complete_purchase

If you’d like to use an event name not listed here, please contact our integration team.

Copy the code snippet and replace the values inside {{double curly brackets}} with your dynamic variables. Remove any optional lines that are not relevant.

Place the finalized script within the <body> of the confirmation page or attach it to the appropriate HTML element for inline triggering.

Using a Tag Manager? Add the Event Pixel as a Custom HTML tag and configure it to trigger after the Universal Site Pixel (USP). In Google Tag Manager, use Tag Sequencing to ensure it only fires once the USP has loaded successfully.

Pixel Script Tag

<script>
tvsci.fireCustomPixel('[[Your_Event_Name_Here]]', {
u4: "{{Unique event identifier}}", //REQUIRED for SALE EVENTS
u2: {{Amount, without currency symbol}}, //REQUIRED for SALE EVENTS
u5: "{{LastTouch_channel}}", //OPTIONAL
u6: "{{CustomerId}}", //OPTIONAL
u8: "{{Customer_Status}}", //OPTIONAL
u12: "{{Note}}", //OPTIONAL
u13: [{{Items Array}] //OPTIONAL
u14: "{{Promo_code}}", //OPTIONAL
u15: "USD" //OPTIONAL
});
</script>

You can delete the lines labeled as optional if you don't intend to pass those values.

Example pixel with sample values filled in:

<script>
tvsci.fireCustomPixel('viewed_product', {
u4: "127856838073",
u5: "PaidSearch",
u12: "LEGO - Star Wars ",
});
</script>

Custom Event Pixel with Auto generated order Id

The Pixel tracks specific user actions and should fire after a successful event.

This version of the pixel will automatically generate an orderId if one is not provided. It is especially helpful if you don’t have access to the website’s data layer.

If an orderId is included in the pixel, it will be overwritten by the auto-generated value. Please note, the same ID will persist for the duration of the browser session and will be reused if the pixel fires again.

Replace [[Your_Event_Name_Here]] with one of the supported event names:

  • lead_generated

  • add_to_cart

  • complete_registration

  • start_checkout

  • trial_started

  • viewed_product

  • complete_purchase

If you’d like to use an event name not listed here, please contact our integration team.

Copy the code snippet and replace the values inside {{double curly brackets}} with your dynamic variables. Remove any optional lines that aren’t relevant.

Place the final script within the <body> of the confirmation page or inline with the relevant element.

Using a Tag Manager? Add the Event Pixel as a Custom HTML tag and configure it to trigger after the Universal Site Pixel (USP). In Google Tag Manager, use Tag Sequencing to ensure it only fires once the USP has loaded successfully.

Pixel Script Tag

<script>
tvsci.fireCustomPixelWithAutoOrderId('[[Your_Event_Name_Here]]', {
u2: {{Amount, without currency symbol}}, //REQUIRED for SALE EVENTS
u5: "{{LastTouch_channel}}", //OPTIONAL
u6: "{{CustomerId}}", //OPTIONAL
u8: "{{Customer_Status}}", //OPTIONAL
u12: "{{Note}}", //OPTIONAL
u13: [{{Items Array}] //OPTIONAL
u14: "{{Promo_code}}", //OPTIONAL
u15: "USD" //OPTIONAL
});
</script>

You can delete the lines labeled as optional if you don't intend to pass those values.

Example of a pixel for add to cart event:

<script>
tvsci.fireCustomPixel('add_to_cart', {
});
</script>

Last Touch Channel

The Hosted Pixel can automatically detect and capture the last touch marketing channel that brought a user to your site. This value is stored for the user’s current session and automatically passed along in the lastTouchChannel parameter during conversion events — helping you track which marketing channel drove the conversion.

💡 Read more about configuring your Last Touch Channel Rule here.


Pixel Dynamic Values

Parameters should be passed from your website using dynamic variables when a conversion occurs. You can delete the lines labeled as optional if you don't intend to pass those values.

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 items data array

[
{
"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?