Skip to main content

How do I get an order's UTM data programmatically?

Hi,

I need to read an order's UTM values (utm_source, utm_medium, utm_campaign, utm_content, utm_id, utm_term) β€” the same ones shown in the order's "UTM Details" panel.

  • The Webhook integration does not include UTM in its payload.
  • $order->orderMeta has no UTM (only _fc_cid).
  • The cart from Cart::where('order_id', $order->id)->first() has an empty utm_data.

Questions

  1. Where is an order's UTM data actually stored?
  2. How do I get those 6 UTM values for a given order in PHP (e.g. inside fluent_cart/order_paid_done)?

Thanks!

Taylor Drayson

Something like this should work: https://snippets.tdrayson.com/85ybz1/

UTMs live in fct_order_operations, model: fluent-cart/app/Models/OrderOperation.php.

Yuhei Kuwahata

Taylor DraysonΒ Thanks so much! Pulling the values from OrderOperation worked perfectly β€” I can now get all of the UTM values.