Skip to main content

Set-Click Endpoint

Updated this week

Overview

The Set-Click endpoint allows you to record conversion events associated with user clicks. This endpoint is particularly useful for tracking offline conversions or conversions that happen outside your main website flow, such as phone calls or in-person visits that originated from online marketing efforts.

Endpoint Details

- Method: POST

- Authentication: Bearer Token required

- Content-Type: application/x-www-form-urlencoded

Request Parameters

Headers

Header

Value

Required

Authorization

Bearer {your_access_token}

Yes

Content-Type

application/x-www-form-urlencoded

Yes

Accept

application/json

Yes

Body Parameters

Parameter

Type

Required

Description

account_id

string

Yes

Your account identifier (must match with your client_id)

url_parameters

object

Yes

JSON object containing UTM parameters (utm_medium, utm_source, etc.)

click_time

number

Yes

Timestamp of the click (Unix timestamp in milliseconds)

settings

object

Yes

JSON object containing settings like email

referrer

string

No

Referrer URL

current_url

string

No

Current URL

Example Request

cURL

```bash

--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI:ImpoaS1Nzg5MzQzIn0...' \

--header 'Content-Type: application/x-www-form-urlencoded' \

--header 'Accept: application/json' \

--data-urlencode 'url_parameters={"utm_medium":"my-medium-01","utm_source":"my-source-01"}' \

--data-urlencode 'click_time=1634707888' \

--data-urlencode 'settings={"email":"[email protected]"}' \

--data-urlencode 'referrer="https://facebook.com/"' \

--data-urlencode 'current_url="https://sealmetrics.com/"' \

--data-urlencode 'account_id=60a52f6ac660b269d13c3f53'

```

Python

```python

import requests

payload = {

'account_id': '60a52f6ac660b269d13c3f53',

'url_parameters': '{"utm_medium":"my-medium-01","utm_source":"my-source-01"}',

'click_time': '1634707888',

'settings': '{"email":"[email protected]"}',

'referrer': '"https://facebook.com/"',

'current_url': '"https://sealmetrics.com/"'

}

headers = {

'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI:ImpoaS1Nzg5MzQzIn0...',

'Content-Type': 'application/x-www-form-urlencoded',

'Accept': 'application/json'

}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

JavaScript

```javascript

var myHeaders = new Headers();

myHeaders.append("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImp0aSI:ImpoaS1Nzg5MzQzIn0...");

myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

myHeaders.append("Accept", "application/json");

var urlencoded = new URLSearchParams();

urlencoded.append("account_id", "60a52f6ac660b269d13c3f53");

urlencoded.append("url_parameters", "{\"utm_medium\":\"my-medium-01\",\"utm_source\":\"my-source-01\"}");

urlencoded.append("click_time", "1634707888");

urlencoded.append("settings", "{\"email\":\"[email protected]\"}");

urlencoded.append("referrer", "\"https://facebook.com/\"");

urlencoded.append("current_url", "\"https://sealmetrics.com/\"");

var requestOptions = {

method: 'POST',

headers: myHeaders,

body: urlencoded,

redirect: 'follow'

};

.then(response => response.text())

.then(result => console.log(result))

.catch(error => console.log('error', error));

```

Response

Success Response (200 OK)

This request doesn't return any response body when successful.

```

No response body

```

Error Response (401 Unauthorized)

```json

{

"status": "error",

"message": "Unauthenticated"

}

```

Error Response (400 Bad Request)

```json

{

"status": "error",

"message": "Missing required parameter: account_id"

}

```

Notes

- This endpoint applies a conversion to the last click of the journey

- You need offline-leads scope enabled in your Adinton user to use this method

- The `account_id` parameter must match with your client_id from your credentials

- The `url_parameters` should include all relevant UTM parameters as a JSON object

- If you want to create a microconversion, you have to include "microconversion":"1" in the lead parameter

- This endpoint is particularly useful for connecting offline conversions with online marketing efforts

- All parameters should be properly URL-encoded when sent in the request

Did this answer your question?