OverviewProductsPlatformsAPI ReferenceResources
Conversions API

Create conversion action

POSThttps://zernio.com/api/v1/ads/conversions/actions

Creates a Google Ads conversion action: a website one counted by a tag on your site, or one counted from the conversions you send to Zernio.

  • type: WEBPAGE creates a website action and returns it with the tag snippets to install, read back after creation since Google never returns them on the create response itself.
  • type: UPLOAD_CLICKS creates an action for the conversions sent with POST /v1/events, the same action POST /v1/ads/conversions/destinations creates. It is secondary unless primaryForGoal: true.

The category defaults to DEFAULT. A name already used by another action returns Google's error.

Clears the cached list that GET on this resource would otherwise keep serving. Google-only; other platforms return 501. Requires the Ads add-on.

PlatformsGoogle

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Body

application/json

What every request needs

accountIdstringRequired

SocialAccount ID. Must be a googleads account.

namestring, max 100Required
typestringRequiredOne of WEBPAGE | UPLOAD_CLICKS

WEBPAGE for a website tag, UPLOAD_CLICKS for the conversions you send to Zernio.

Optional parameters10 fields
adAccountIdstring

Platform ad account ID (Google customer ID, digits only). Resolved automatically when the connection has exactly one accessible customer.

customerIdDeprecatedstring

Alias of adAccountId, kept for existing callers

defaultValuenumber

Default conversion value used when an event doesn't carry its own value.

alwaysUseDefaultValueboolean

When true, always use defaultValue and ignore any value sent with the event. Defaults to true when defaultValue is set.

categorystringOne of DEFAULT | PAGE_VIEW | PURCHASE | SIGNUP | DOWNLOAD | ADD_TO_CART | BEGIN_CHECKOUT | SUBSCRIBE_PAID | PHONE_CALL_LEAD | IMPORTED_LEAD | SUBMIT_LEAD_FORM | BOOK_APPOINTMENT | REQUEST_QUOTE | GET_DIRECTIONS | OUTBOUND_CLICK | CONTACT | ENGAGEMENT | STORE_VISIT | STORE_SALE | QUALIFIED_LEAD | CONVERTED_LEAD

conversion_action.category. Defaults to DEFAULT on create.

countingTypestringOne of ONE_PER_CLICK | MANY_PER_CLICK

ONE_PER_CLICK counts one conversion per ad click (leads); MANY_PER_CLICK counts every one (purchases).

defaultCurrencystring

ISO 4217 currency of defaultValue (value_settings.default_currency_code).

clickThroughLookbackWindowDaysinteger

Days after an ad click a conversion still counts.

viewThroughLookbackWindowDaysinteger

Days after an ad view a view-through conversion still counts.

primaryForGoalboolean

true = primary (counts toward bidding when its goal is biddable), false = secondary. Defaults to secondary for UPLOAD_CLICKS.

Responses

Success· the request worked

Errors· the request failed

POST/v1/ads/conversions/actions
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.conversions.createConversionAction({  body: {    accountId: 'account_abc123',    name: 'Example',    type: 'WEBPAGE',  },});console.log(data);
{  "action": {    "id": "string",    "name": "string",    "type": "string",    "status": "string",    "category": "string",    "origin": "string",    "primaryForGoal": true,    "defaultValue": 0,    "defaultCurrency": "string",    "alwaysUseDefaultValue": true,    "countingType": "string",    "clickThroughLookbackWindowDays": 0,    "viewThroughLookbackWindowDays": 0,    "tagSnippets": [      {        "type": "string",        "pageFormat": "string",        "globalSiteTag": "string",        "eventSnippet": "string"      }    ]  }}
OpenAPI specification
Was this page helpful?