Shopify Cash on Delivery Tracking
Send Purchase only when a Cash on Delivery order is paid, and exclude the customers who never pay from your Facebook and TikTok ads.
A Cash on Delivery order is not a sale until the customer pays at the door. Some customers refuse the delivery and never pay. When those orders count as sales, your ad platforms learn from them and look for more customers like them.
By default, AnyTrack sends Purchase when Shopify creates an order, paid or not. This guide changes the trigger: AnyTrack sends Purchase when Shopify marks the order as paid. Unpaid orders arrive as an OrderCreated event instead. You then send OrderCreated to your pixels and exclude the customers who did not pay from your ads.
Cash on Delivery: One Order, Two Outcomes
Shared start:
- Customer orders with Cash on Delivery. Tools: Shopify. The order is created with payment pending. The customer pays when the order arrives.
- Order arrives as
OrderCreated. Tools: AnyTrack. The Order creation webhook sends the order. Order created is mapped toOrderCreated, not toPurchase. Data: OrderCreated (present), Purchase (missing).
The path splits here: does the customer pay?
Path 1, working path: Customer pays on delivery.
- You mark the order as paid. Tools: Shopify. The Order payment webhook sends the payment. Order paid is mapped to
Purchase. Data: Purchase (present). Purchasegoes to your ad platforms. Tools: Facebook Ads, TikTok Ads. The ad platforms learn from paid orders only.
Path 2: Customer refuses the delivery.
- The order stays unpaid. Tools: Shopify. Nobody marks the order as paid, so no
Purchaseis sent. Data: Purchase (missing). - Customer joins the Unpaid orders audience. Tools: Facebook Ads, TikTok Ads. The audience includes
OrderCreatedand excludes paid orders.
Path 1 result: Paid order counts as a sale. Your campaigns optimize for customers who pay.
Path 2 result: Excluded from your ads. Your ad sets stop reaching customers who refused a delivery.
One mapping makes the difference. Give Order created its own event name, then map Order paid to Purchase. Unpaid orders then never count as sales, and they become an audience you can exclude.
For the base setup, refer to the Shopify integration guide.
Step 1: Add the Order payment webhook in Shopify
Section titled “Step 1: Add the Order payment webhook in Shopify”🔑 Shopify admin (Settings → Notifications)
The Order paid event in AnyTrack needs one more Shopify webhook: Order payment.
- In AnyTrack, open your Shopify integration and copy the Webhook URL.
- In your Shopify admin, go to Settings → Notifications.
- Scroll to the Webhooks section and click Create webhook.
- In Event, select Order payment.
- Leave the format as
JSON. - Paste the AnyTrack Webhook URL.
- Set the Webhook API version to the latest stable version.
- Click Save.
Step 2: Map Order paid to Purchase in AnyTrack
Section titled “Step 2: Map Order paid to Purchase in AnyTrack”🔑 AnyTrack Dashboard (Integrations → Shopify)
- In AnyTrack, open your Shopify integration and go to Shopify Integration Events.
- Find Order created and change its event name to
OrderCreated. - Find Order paid and set its event to
Purchase. - Save the integration.
This mapping applies to every order, not only to Cash on Delivery. With Shopify’s default payment capture (automatically at checkout), a card order is paid at checkout, so its Purchase arrives at once. If your store captures card payments manually or at fulfillment, AnyTrack sends Purchase when you capture the payment.
Step 3: Send OrderCreated to your pixels and exclude unpaid orders
Section titled “Step 3: Send OrderCreated to your pixels and exclude unpaid orders”🔑 AnyTrack Dashboard (Tracking Pixels) and your ad accounts
This step turns unpaid orders into an audience. The audience holds the customers who placed an order and did not pay, or who refused the delivery. Exclude it from your ad sets, so you stop paying to reach these customers again.
Send OrderCreated to your Facebook Pixel
Section titled “Send OrderCreated to your Facebook Pixel”- In AnyTrack, go to Tracking Pixels and open your Facebook Pixel.
- Select the
OrderCreatedevent. - Enter the event name that Facebook receives, for example
OrderCreated. - Click Save.
Do the same for your TikTok Pixel. For more about custom event names, refer to Event Mapping.
Build the Unpaid orders audience in Meta
Section titled “Build the Unpaid orders audience in Meta”- In Meta Ads Manager, go to Audiences.
- Click Create audience, then Custom audience.
- Select Website as the source and select your pixel.
- In the include rule, select the event that AnyTrack sends for
OrderCreated. - Click Exclude people and select the
Purchaseevent. This is the Facebook event that AnyTrack sends forPurchase. - Name the audience, for example “Unpaid orders”, and create it.
- Exclude the audience in your prospecting and retargeting ad sets.
Source: Meta Business Help Center, How to create a website custom audience.
Build the Unpaid orders audience in TikTok
Section titled “Build the Unpaid orders audience in TikTok”- In TikTok Ads Manager, go to Tools → Audiences.
- Click Create audience, then Custom Audience, then Website Traffic.
- Include the people who triggered the event that AnyTrack sends for
OrderCreated. - Use Exclude People to remove the people who triggered
CompletePayment. This is the TikTok event that AnyTrack sends forPurchase. If you changed that mapping, select your mapped event. - Name the audience and click Confirm.
- Exclude the audience in your ad groups.
Source: TikTok Business Help Center, How to create a Website Traffic audience.
Step 4: Test the setup
Section titled “Step 4: Test the setup”- Place a test order on your store and select Cash on Delivery.
- In AnyTrack, open the Shopify integration Events Log. The order shows as
OrderCreated. NoPurchaseshows yet. - In your Shopify admin, open the order and click Collect payment → Mark as paid.
- Click Refresh in the Events Log. The
Purchaseevent shows.
Video walkthrough
Section titled “Video walkthrough”Frequently Asked Questions
FAQ was last reviewed on 2026-11-12
What happens when a customer refuses the delivery?
Purchase. The customer stays in the Unpaid orders audience, and your ads stop reaching them.Can I show ads to unpaid orders instead of excluding them?
The customer pays a few days after the order. Is the Purchase still attributed?
Purchase when you mark the order as paid. Each ad platform attributes the event within its own attribution window.Do I still need the Order creation webhook?
OrderCreated event. Without it, the Unpaid orders audience stays empty.