MarketingAttribution

interface MarketingAttribution { utm_source?: string; utm_medium?: string; utm_campaign?: string; utm_term?: string; utm_content?: string; gclid?: string; affiliate?: string; funnel?: string; subaffiliate1?: string; subaffiliate2?: string; subaffiliate3?: string; subaffiliate4?: string; subaffiliate5?: string; metadata?: Record<string, any>; }

Source: api.ts:354

Where a visitor came from, captured on the cart and carried onto the Order — the UTM parameters, click ids, affiliate and funnel of the visit that converted.

Every field is optional: a direct visit with no campaign parameters produces an object with almost nothing in it, and absent means "not present on the landing URL", never "attribution failed".


Properties

utm_source: string

utm_source — which site or channel sent the visit.

utm_medium: string

utm_medium — the kind of traffic, e.g. "cpc", "email".

utm_campaign: string

utm_campaign — the campaign name the ad or email belonged to.

utm_term: string

utm_term — the paid keyword, when the source supplies one.

utm_content: string

utm_content — which creative or link variant was clicked.

gclid: string

Google click id, for matching the order back to a Google Ads click.

affiliate: string

Affiliate identifier credited with the sale.

funnel: string

Funnel identifier for the page flow the visitor went through.

subaffiliate1: string

First affiliate sub-id, as passed on the landing URL.

subaffiliate2: string

Second affiliate sub-id.

subaffiliate3: string

Third affiliate sub-id.

subaffiliate4: string

Fourth affiliate sub-id.

subaffiliate5: string

Fifth affiliate sub-id.

metadata: Record<string, any>

Everything else the SDK recorded about the visit — landing page, referrer, device, timestamp, and any custom values the page added.