awe.sm Conversion Tracking Endpoint
You must enable conversion tracking on your project before continuing.
Conversions can be tracked server-side using this API if you don't wish to use the JavaScript library method.
Note: If you are not using the awe.sm JavaScript library, you must store the awesm URL parameter when an awe.sm link initially redirects to your site to register conversions.
GETapi.awe.sm/conversions/new
HTTPS is supported on this endpoint.
Required Parameters
| Parameter | Type | Description |
|---|---|---|
| awesm_url | string | The awesm_id of the awe.sm link that led to this conversion, e.g. awe.sm_4kfyL. This can be retrieved from the _awesmsession cookie set by the tracking JavaScript. |
| conversion_type | string | The conversion type: pageview, goal_1, goal_2, goal_3, goal_4, goal_5, goal_6, goal_7, goal_8, goal_9, or goal_10 |
| conversion_value | integer | The integer value of the conversion event. If you are specifying a precise dollar value, we recommend specifying the value in cents, e.g. $1.57 would be 157, $10 would be 1000. This does not have to be a dollar value — you can set any value and our APIs will sum the values for you. This value is ignored when type=pageview. |
| key | string | API key of the project with which the conversion should be associated. |
Optional Parameters
These parameters provide additional context for a user's conversion. These values should be taken from the user's HTTP request.
| Parameter | Type | Description |
|---|---|---|
| account_conversionid | string | An arbitrary identifier you can supply to identify this individual conversion, such as your application's internal transaction id. 50 character max. |
| account_userid | string | An arbitrary identifier you can supply to identify this user later, such as your application's internal user id. 50 character max. |
| converted_at | timestamp | A UNIX epoch timestamp of the time of conversion. Default is the time of the API request. |
| ip_address | string | The IP address of the user, e.g. 184.19.143.10 |
| language | string | The HTTP accept-language header sent by the user's browser. |
| referrer | string | The HTTP referrer header sent by the user's browser, i.e. the page they came from to get to the current page |
| session_id | string | The session_id from the _awesmsession cookie. |
| user_agent | string | The user-agent string of the user's browser |
Advanced Optional Parameters
Our server can infer metadata from HTTP headers if the read_headers parameter is set to true. Your server will need to capture the HTTP headers of your user, then set the headers of your server's request to the same values. We also support the X_FORWARDED_FOR header for IP address.
WARNING: if you do not set these headers correctly and read_headers is enabled, we will be capturing the IP address, user-agent, and other headers of your server, rather than your user.
| Parameter | Type | Description |
|---|---|---|
| read_headers | boolean | If TRUE, our server will attempt to determine the values above automatically from HTTP header information. Default is FALSE. |
Related
- Enabling conversion tracking on your project
- JavaScript based conversion goal tracking
- Image based conversion goal tracking
The _awesmsession Cookie
When a user arrives via an awe.sm-powered link, our servers append an awesm= parameter to the end of the URL. To get the awesm_url you need for your conversion call, if you are on the original landing page, you can read this value directly. However, a conversion often happens on a page a few clicks away from the landing page. To satisfy this case, our conversion tracking script captures the awesm_url in a cookie called _awesmsession. We set this cookie on your domain, and it is unique to your domain, so your server can read it. The value of the cookie is:
{session_id}:{awesm_url}
Split the value of the cookie on ":" to extract the awesm_url and session_id.
Example
Register a $12.30 conversion on goal_1 on the link http://awe.sm/5WXHo
GET http://api.awe.sm/conversions/new?key=f2d8aeb112f1e0bedd7c05653e3265d2622635a3180f336f73b172267f7fe6ee&awesm_url=awe.sm_5WXHo&conversion_type=goal_1&conversion_value=1230
{
"request": {
"action": "new",
"awesm_url": "awe.sm_5WXHo",
"controller": "conversion",
"conversion_type": "goal_1",
"conversion_value": "1230",
"key": "f2d8aeb112f1e0bedd7c05653e3265d2622635a3180f336f73b172267f7fe6ee"
},
"response": {
"conversion": {
"account_conversionid": null,
"account_id": "12",
"account_userid": null,
"awesm_url": "awe.sm_5WXHo",
"clicker_id": null,
"converted_at": 1317850014,
"href": null,
"id": "238ea66b-e267-45cf-85a6-e0c21580f1e6",
"ip_address": null,
"language": null,
"redirection_id": "94585739",
"referrer": null,
"session_id": null,
"type": "goal_1",
"user_agent": null,
"value": 1230
}
}
}
Last updated 2012-10-17