Skip to main content

GoalTriggerInput

One trigger for goalCreate or goalEdit: a JSON filter that defines when the goal converts, plus optional conversion value settings.

input GoalTriggerInput {
id: Int
name: String
autoName: String
filter: String!
valueType: GoalValueType
fixedValue: GoalFixedValueInput
elementValue: GoalElementValueInput
}

Fields​

GoalTriggerInput.id ● Int scalar​

Existing trigger id from goalDetail, used only by goalEdit to update it; omit to create.

GoalTriggerInput.name ● String scalar​

Optional trigger name. Must be at most 20 characters.

GoalTriggerInput.autoName ● String scalar​

Fallback trigger label stored as given; the web app sends Trigger 1, Trigger 2, and so on.

GoalTriggerInput.filter ● String! non-null scalar​

JSON-encoded string with one trigger filter: an object with integer version 3 (legacy 2 is still accepted), operator OR or AND, and a non-empty conditions array. Send one condition per trigger and use separate triggers for alternatives. Each condition has criteria, multiple_values set to or, and a values array, and never comparison. goalDetail returns existing filters in this format. Example: {"version":3,"operator":"OR","conditions":[{"criteria":"url_visit","multiple_values":"or","values":["https://example.com/thanks"]}]}. url_visit values are non-empty page URL strings. code values are non-empty conversion codes that the page passes to CE2.converted, for example {"criteria":"code","multiple_values":"or","values":["signup"]}. click and form_submission values are objects with strings auto_name, source_url, selector_for_desktop, selector_for_tablet, and selector_for_phone, booleans sync_selectors and on_any_page, selector_source (manual for your own CSS selectors, specific, or broad), and optional name, preview_url, and on_page; form submissions also need non-empty source_url and selectors. Example: {"criteria":"click","multiple_values":"or","values":[{"auto_name":"Buy","source_url":"https://example.com","selector_for_desktop":"#buy","selector_for_tablet":"#buy","selector_for_phone":"#buy","selector_source":"manual","sync_selectors":true,"on_any_page":true}]}. pixel_event values are objects with boolean on_any_page, api (google, tiktok, meta, or ga4), and optional id and event, for example {"criteria":"pixel_event","multiple_values":"or","values":[{"on_any_page":true,"api":"meta","event":"Purchase"}]}. ecommerce_event values are objects with boolean on_any_page, api (shopify, woocommerce, magento, wixapi, squarespace, or generic), and event (addToCart, startCheckout, or checkoutCompleted), for example {"criteria":"ecommerce_event","multiple_values":"or","values":[{"on_any_page":true,"api":"woocommerce","event":"checkoutCompleted"}]}. A Shopify ecommerce_event trigger is saved as an api trigger named after the goal. api triggers are created automatically with {"criteria":"api","multiple_values":"or","values":[]}; keep one by resending its id and filter unchanged.

GoalTriggerInput.valueType ● GoalValueType enum​

Source of the conversion value; omit for no value. Set fixedValue for FIXED and elementValue for ELEMENT.

GoalTriggerInput.fixedValue ● GoalFixedValueInput input​

Amount settings for valueType: FIXED; null otherwise.

GoalTriggerInput.elementValue ● GoalElementValueInput input​

Page element settings for valueType: ELEMENT; null otherwise.

Member Of​

GoalCreateParams input ● GoalEditParams input