Skip to main content

Custom Pixel Code

The order item object type is:
finalLinePrice is the line total before discount allocations — typically variant.price.amount * quantity, matching Shopify checkout line items. Do not pre-subtract discounts. Pass Shopify discountAllocations on the line; Videowise subtracts them. Allocations whose discountApplication.targetType is SHIPPING_LINE are ignored. Example orderItems payload:

Running the pixel

Copy the pixel code and use it as a custom js script on your website. Whenever you have a successful order, call the VWPixel function with the following arguments:
  • orderId: The order ID
  • orderTotal: The order total
  • orderCurrency: The order currency
  • orderItems: The order items (see the OrderItem type above, including optional discountAllocations)
  • shippingCosts (optional): Shipping amount. Sent as shipping_costs. Defaults to 0
  • taxAmount (optional): Tax amount. Sent as tax_amount. Defaults to 0
Note: some keys are optional, but it’s recommended to pass all the arguments. On the web, referral is not an argument. The snippet sends it from the reeview_referral cookie. For a mobile app, use trackingPixel — the SDK sets referral with vw_referral_channel: "mobile_app". A custom mobile pixel (no SDK) must send that object itself or the order is not attributed to MOBILE APP. See Live shopping order tracking. Example:

Google Tag Manager (GTM)

If you manage your scripts through Google Tag Manager, you can fire the Videowise pixel from a Custom HTML tag that reads the order data from the dataLayer. This is the recommended approach when you don’t have direct access to your theme/template code, or when your order data is already available as a dataLayer event (for example a GA4 purchase event). The flow has three parts:
  1. Your store/site pushes a purchase event with the order data to the dataLayer.
  2. A GTM trigger listens for that event.
  3. A GTM Custom HTML tag runs the VWPixel function using values read from the dataLayer.

1. Push the order data to the dataLayer

On your order confirmation / thank-you page, push an event to the dataLayer as soon as the order is successful. Make sure window.dataLayer is initialized before the GTM snippet runs.

2. Create the data layer variables

In GTM, create Data Layer Variables so the tag can read each field:

3. Create the trigger

Create a Custom Event trigger that fires on the event name you pushed:
  • Trigger type: Custom Event
  • Event name: vw_purchase (or your existing purchase event)

4. Create the Custom HTML tag

Create a Custom HTML tag, set it to fire on the trigger above, and paste the VWPixel function (from the top of this page) followed by an invocation that uses the GTM variables:
GTM variable references like {{DLV - orderId}} are replaced with their actual values when the tag runs. String values are inserted with surrounding quotes automatically, while objects/arrays (such as orderItems) are injected as JSON, so they don’t need extra quotes.

5. Verify

Use GTM Preview mode to place a test order and confirm the tag fires on the purchase event. When it runs successfully you’ll see the following message in the browser console: