Create or update a Google Ads conversion action
PUT https://services.leadconnectorhq.com/ad-publishing/google/conversions
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Body
locationId
string
default:"loc_abc123"
required
Account identifier
name
string
default:"Purchase Conversion"
required
Conversion name
type
string
default:"WEBPAGE"
required
Conversion type Posibles valores: ‘UPLOAD_CLICKS’, ‘UPLOAD_CALLS’, ‘WEBPAGE’, ‘LEAD_FORM_SUBMIT’
category
string
default:"PURCHASE"
required
Conversion category
Value settings that control how monetary value is attributed to conversions
countingType
string
default:"ONE_PER_CLICK"
required
How conversions are counted per interaction Posibles valores: ‘ONE_PER_CLICK’, ‘MANY_PER_CLICK’
attributionModel
string
default:"GOOGLE_ADS_LAST_CLICK"
required
Attribution model used to credit conversions Posibles valores: ‘GOOGLE_SEARCH_ATTRIBUTION_DATA_DRIVEN’, ‘GOOGLE_ADS_LAST_CLICK’
clickThroughWindow
number
default:"30"
required
Click-through conversion window in days
Respuestas
422 - Unprocessable Entity
Ejemplo
curl -X PUT 'https://services.leadconnectorhq.com/ad-publishing/google/conversions' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "loc_abc123",
"conversionId": "conv_456",
"name": "Purchase Conversion",
"type": "WEBPAGE",
"category": "PURCHASE",
"valueSettings": {
"defaultValue": "10.00",
"defaultCurrencyCode": "USD",
"alwaysUseDefaultValue": false
},
"countingType": "ONE_PER_CLICK",
"attributionModel": "GOOGLE_ADS_LAST_CLICK",
"clickThroughWindow": 30
}'
const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/google/conversions', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "loc_abc123", "conversionId": "conv_456", "name": "Purchase Conversion", "type": "WEBPAGE", "category": "PURCHASE", "valueSettings": {"defaultValue": "10.00", "defaultCurrencyCode": "USD", "alwaysUseDefaultValue": false}, "countingType": "ONE_PER_CLICK", "attributionModel": "GOOGLE_ADS_LAST_CLICK", "clickThroughWindow": 30}),
});
const data = await response.json();
import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/ad-publishing/google/conversions',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "loc_abc123", "conversionId": "conv_456", "name": "Purchase Conversion", "type": "WEBPAGE", "category": "PURCHASE", "valueSettings": {"defaultValue": "10.00", "defaultCurrencyCode": "USD", "alwaysUseDefaultValue": false}, "countingType": "ONE_PER_CLICK", "attributionModel": "GOOGLE_ADS_LAST_CLICK", "clickThroughWindow": 30},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/google/conversions');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'locationId': 'loc_abc123', 'conversionId': 'conv_456', 'name': 'Purchase Conversion', 'type': 'WEBPAGE', 'category': 'PURCHASE', 'valueSettings': {'defaultValue': '10.00', 'defaultCurrencyCode': 'USD', 'alwaysUseDefaultValue': false}, 'countingType': 'ONE_PER_CLICK', 'attributionModel': 'GOOGLE_ADS_LAST_CLICK', 'clickThroughWindow': 30}),
]);
$data = json_decode(curl_exec($ch), true);