For the complete documentation index, see llms.txt. This page is also available as Markdown.

Track purchases from a specific collection

What you'll build

A custom event based on purchase, scoped with a trigger condition so it fires only when the order contains a product from one collection.

A collection often maps to a business line: a new range you're launching, a brand within your store, a category with different margins. A dedicated event lets a destination report on, trigger from, or optimize toward that line, while the standard purchase event keeps flowing untouched.

What you need

  • A Shopify collection, product type, or tag that identifies the product line

  • At least one Littledata destination connected, for example Meta Conversions API or Google Analytics

  • Access to the Event Editor in the Littledata app

Steps

1

Add a custom event

Go to Settings for your destination, then open the Events tab.

Click Add event.

2

Name it and pick the base event

Name the event after the line, e.g. SkincarePurchase.

Select Purchase as the base event. The custom event inherits the complete field mappings of its base, so it sends a full, valid payload from the start. See Derive a new custom event.

3

Scope it with a trigger condition

Without a condition, the new event fires on every purchase. Add a condition so it only fires when the order contains a product from the collection:

Field
Operation
Value

products.collections

contains

skincare

products.category

does not equal

Health

products.product_type

does not equal

Health

The event fires when any product in the order matches, so a mixed cart with one skincare item still counts. See Trigger conditions.

4

Preview and save

Use the event preview to check the payload, then click Save.

Destination notes

  • Meta: in Events Manager, mark the event as a custom conversion to run campaigns optimized for the range, for example a launch campaign bidding toward SkincarePurchase rather than any purchase.

  • GA4: mark the event as a key event to compare which channels drive the line, without segmenting every purchase report by item.

  • Klaviyo: use the event as a flow trigger for line-specific post-purchase journeys, for example replenishment reminders for consumables.

Verify it's working

  1. Place a test order containing a product from the collection.

  2. Confirm the new event arrives alongside the standard purchase event, for example in Meta Events Manager or GA4 DebugView.

  3. Orders without a product from the collection should fire purchase only.

Make it yours

This setup is a custom event conditioned on what's in the order. Any product attribute your store maintains can define a line:

  • Condition on product type, vendor, tag, or a SKU prefix instead of a collection.

  • The order value still reflects the whole cart. If the destination should only see the line's revenue, adjust the event's field mappings.

  • Custom events exist per connection. To use the same event in another destination, create it there as well.

Last updated

Was this helpful?