Next Commerce
Tracking

Triple Whale

Track your NEXT campaign in Triple Whale on a store that syncs orders to Shopify. Stores without Shopify can load the pixel but do not get attributed sales yet.

The starter templates include the Triple Whale pixel. Add your Triple Whale details and the pixel loads on every campaign page, so Triple Whale can see the visit.

This guide is for stores that sync their orders to Shopify with Shop Sync, where Triple Whale gets the sale from Shopify. On a store without Shopify, Triple Whale cannot attribute campaign sales yet. See Stores without Shopify.

How it works on a Shop Sync store

  1. The pixel on your campaign records the shopper's visit and where they came from.
  2. When the shopper enters their email or phone at checkout, the campaign sends it to Triple Whale.
  3. Shop Sync creates the order in Shopify, and Triple Whale picks it up from there.
  4. Triple Whale uses the email or phone to connect the Shopify order to the campaign visit.

The campaign does not send the purchase itself. If it did, Triple Whale would see the same sale twice: once from the campaign and once from Shopify.

Before you start

  • A Triple Whale account connected to the Shopify store your orders sync to.
  • Shop Sync set up, so campaign orders reach Shopify with the NEXT tag. See the Shop Sync onboarding guide.
  • A campaign that is ready for tracking. See Set up tracking.

Set up

  1. In Triple Whale, open Settings, then Business Configurations, then Pixel Settings, and select the Pixel Installation tab. Save a Shopify Headless Account Setup to see the Headless Installation snippet.
  2. In the snippet, find TripleName. It is your myshopify.com domain, for example your-store.myshopify.com. Copy it. Do not paste the snippet into your pages; the template already includes it.
  3. In _data/campaigns.json, add these four lines to your campaign:
_data/campaigns.json
{
  "my-campaign": {
    "name": "My Campaign",
    "triplewhale_name": "your-store.myshopify.com",
    "triplewhale_platform": "SHOPIFY",
    "triplewhale_contact_enabled": "true",
    "triplewhale_blocked_events": "dl_purchase, dl_upsell_purchase"
  }
}
  1. Build with npm run build and deploy.
LineWhat it does
triplewhale_nameTurns the pixel on for your Triple Whale shop
triplewhale_platformTies the campaign to your Shopify store in Triple Whale
triplewhale_contact_enabledSends the shopper's email and phone, so the Shopify order can be connected to the visit
triplewhale_blocked_eventsStops the campaign sending the purchase, so the sale is counted once

This sends personal data

triplewhale_contact_enabled sends the shopper's email and phone to Triple Whale as soon as they are entered. It is not tied to the marketing opt-in checkbox. Turn it on only when your privacy policy covers it. See Privacy and consent.

What gets tracked

WhenWhat Triple Whale receives
Any page loadsThe visit
An item is added to the cartAddToCart
The shopper enters an email or phone at checkoutContact
The order syncs to ShopifyThe order, through Triple Whale's Shopify connection

The sale appears in Triple Whale after the order syncs to Shopify, not at the moment of payment. An accepted upsell is added to the same NEXT order, so it is included when that order syncs.

Express wallet buyers

A shopper who pays with Apple Pay, Google Pay or PayPal may never type an email or phone into the checkout. No Contact is sent for them, so Triple Whale may not be able to connect their order to an ad.

Verify it works

  1. Open your campaign in a new private window, with test details on the link, for example ?utm_source=tw-test&utm_campaign=tw-test.
  2. In the browser console, run TriplePixel('State'). It should return "Ready".
  3. Type an email at checkout and place an order.
  4. Check the order reached Shopify with the NEXT tag. A test order is not sent to Shopify automatically, so request fulfillment on it in NEXT. It arrives in Shopify marked as a test order.
  5. In Triple Whale, find the order by the buyer's email and check the source it is attributed to.
What you see in Triple WhaleWhat it means
One order, attributed to your test sourceEverything is working
One order, not attributedThe order arrived from Shopify, but Triple Whale did not connect it to the visit. Check triplewhale_contact_enabled is on and the email matches
Two orders for one saleThe campaign is still sending the purchase. Check triplewhale_blocked_events. If that is set, the order may have shipped in two parts, which shows as two Shopify orders
No orderThe order has not reached Shopify yet, or Triple Whale is not connected to that Shopify store

Triple Whale's Pixel Helper extension only works in a normal Chrome window. In Triple Whale's Pixel Settings, "Online Store: Not Installed" is expected for a campaign.

Stores without Shopify

Attributed sales are not supported yet

Triple Whale attributes a sale by connecting an order record to the shopper's visit. On a Shopify store the order record comes from Shopify. On any other store it has to be sent to Triple Whale's Orders API alongside the pixel's purchase event, and NEXT does not send orders there. Without Shopify, Triple Whale gets the pixel events but no orders, so campaign sales will not be attributed to your ads.

You can still load the pixel to see campaign visits in Triple Whale. Add only this line to your campaign, with your campaign's domain as the value, and leave out the other three lines from the Shop Sync setup:

"triplewhale_name": "campaign.example.com"

The campaign then sends Triple Whale the visit, add to cart, and each purchase and upsell from the browser. Upsells arrive as an UpsellPurchase event. None of these turn into attributed revenue until Triple Whale also receives the order.

If Triple Whale attribution matters for a store without Shopify, use Shop Sync to send the orders to a Shopify store connected to Triple Whale, and follow the setup above.

Troubleshooting

ProblemLikely causeFix
The pixel is not on the pagetriplewhale_name is missing or emptyAdd it and rebuild
Data lands in the wrong Triple Whale shoptriplewhale_name does not match your Triple Whale snippetCopy TripleName from the snippet again
Visits show in Triple Whale but no sales are attributed, on a store without ShopifyTriple Whale gets no order record for the campaign's salesNot supported yet. See Stores without Shopify
Meta counts each order twiceTriple Whale Sonar and the NEXT Meta Pixel app both send it to MetaExclude orders tagged NEXT in Sonar, or use only one of the two

On this page