Raw Conversions Report

Operations to fetch raw conversions

The endpoints documented in this section allow you to pull conversions and post-conversion events from the API. Each conversion / event will be a “row” in the response as the data is not aggregated.

Note that currency conversion is not supported on raw conversion endpoints. Conversions are always stored in the currency of the offer they belong to and this is how the endpoints return raw conversions.


Conversion Report

POST /v1/affiliates/reporting/conversions

The conversion report is the most flexible way to extract a list of conversions and post-conversion events. It allows you to fetch a list of conversions and post-conversion events while specifying filters to narrow down the scope of the set of data you are pulling.

Each request must contain :

  • from and to dates (format can be YYYY-mm-DD or YYYY-mm-DD hh:mm:ss)
  • The timezone_id used for the request. Find all timezones here
  • A show_conversions boolean value that determines whether base conversions are returned (true / false)
  • A show_events boolean value that determines whether post-conversion events are returned (true / false)

Optional query filters can be added to the call

Paging

This endpoint supports paging. Refer to our User Guide for usage.

Query filters allow you to limit the scope of the report returned by the API. You could create a filter to limit the reporting data to a single partner for example. You can use multiple filters in a request.

Filters that apply to the same resource_type will act as OR operator. Different resource_type work with an AND operator. The following filters :

{
  //...
  "query": {
    "filters": [
      {
          "filter_id_value": "883",
          "resource_type": "offer"
      },
      {
          "filter_id_value": "518",
          "resource_type": "offer"
      },
      {
          "filter_id_value": "United States",
          "resource_type": "country"
      }
    ]
  }
}

translate to “Pull conversions for US traffic on offer 883 OR offer 518”.

The resource-type used in the query filters can take the following values :

offer, offer_creative, transaction_id, campaign, sub1, sub2, sub3, sub4, sub5, source_id, country, offer_url, browser, carrier, coupon_code, dma, device_brand, device_type, language, os_version, platform, region

Here are a few variations of what you can pass as a payload in ithe following call :

curl --request POST 'https://api.eflow.team/v1/affiliates/reporting/conversions' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'

Example 1 : Pull all conversions (but no events) over a 1 hour period

{
    "from": "2022-02-08 13:00:00",
    "to": "2022-02-08 14:00:00",
    "timezone_id": 67,
    "show_conversions": true,
    "show_events": false,
    "query":{
        "filters": [
    <span style="color:#000;font-weight:bold">]</span>
<span style="color:#000;font-weight:bold">}</span>

}

Example 2 : Pull conversions and events on offer ID 800

{
    "from": "2022-02-07",
    "to": "2022-02-10",
    "timezone_id": 80,
    "show_conversions": true,
    "show_events": true,
    "query":{
        "filters": [
            {
                "filter_id_value": "800",
                "resource_type": "offer"
            }
        ]
    }
}

Example 3 : Pull all conversions and events that were generated from either of these 2 transaction IDs

{
    "from": "2022-02-01",
    "to": "2022-02-10",
    "timezone_id": 80,
    "show_conversions": true,
    "show_events": true,
    "query":{
        "filters": [
            {
                "filter_id_value": "e33e03d630a04f499835cfa3d3158baf",
                "resource_type": "transaction_id"
            },
            {
                "filter_id_value": "2718b9f7adeb4d98869767bc1202edf5",
                "resource_type": "transaction_id"
            }
        ]
    }
}

A response from the conversion report endpoint will look like :

{
	"conversions": [
		{
			"conversion_id": "f9d3fa7e86d241afbec4a6c6c3fe2580",
			"conversion_unix_timestamp": 1661970244,
			"sub1": "internal",
			"sub2": "",
			"sub3": "facebook",
			"sub4": "",
			"sub5": "",
			"source_id": "",
			"revenue_type": "CPA",
			"revenue": 0.8,
			"session_user_ip": "217.66.156.135",
			"conversion_user_ip": "",
			"country": "Russia",
			"region": "Sankt-peterburg",
			"city": "St Petersburg",
			"dma": 0,
			"carrier": "MTS Russia",
			"platform": "macOS",
			"os_version": "",
			"device_type": "PC",
			"brand": "Apple",
			"browser": "Safari",
			"language": "en",
			"http_user_agent": "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_7_2 rv:5.0) Gecko/20111121 Firefox/5.0.1",
			"is_event": false,
			"event": "",
			"transaction_id": "a22f8a1b5fde4801a2ed3dceabf4f8a3",
			"click_unix_timestamp": 1661970238,
			"isp": "mts ojsc",
			"referer": "",
			"app_id": "",
			"idfa": "",
			"idfa_md5": "",
			"idfa_sha1": "",
			"google_ad_id": "",
			"google_ad_id_md5": "",
			"google_ad_id_sha1": "",
			"android_id": "",
			"android_id_md5": "",
			"android_id_sha1": "",
			"currency_id": "USD",
			"is_view_through": false,
			"order_id": "",
			"adv1": "",
			"adv2": "",
			"adv3": "",
			"adv4": "",
			"adv5": "",
			"relationship": {
				"offer": {
					"network_offer_id": 3,
					"network_id": 1,
					"name": "Daily Car",
					"offer_status": "active",
					"network_tracking_domain_id": 1
				},
				"events_count": 0
			}
		},
		// ...
	],
	"paging": {
		"page": 1,
		"page_size": 2000,
		"total_count": 2
	}
}

Conversion Report Export

POST /v1/affiliates/reporting/conversions/export

The export endpoint is very similar to the report endpoint documented above but lets you export in CSV or JSON format.

Please note that when using the JSON format, the results will be newlined delimited JSON.

You must add the format properly to the payloads from the regular table endpoint for requests to work on this endpoint. The format can be either :

  • csv
  • json

cURL
curl --request POST 'https://api.eflow.team/v1/affiliates/reporting/conversions/export' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'

Example : Export conversions and events on offer 800 in JSON format

{
    "from": "2022-02-07",
    "to": "2022-02-10",
    "timezone_id": 80,
    "show_conversions": true,
    "show_events": true,
    "query":{
        "filters": [
            {
                "filter_id_value": "800",
                "resource_type": "offer"
            }
        ]
    },
    "format": "json"

}


Conversion By ID

GET /v1/affiliates/reporting/conversions/:conversionId

Fetch a single conversion by its unique conversion ID.

Path Parameters

Parameter Description
conversionId The ID of the conversion (32 char)

cURL
curl --request GET 'https://api.eflow.team/v1/affiliates/reporting/conversions/<32 char Conversion ID>' \
--header 'X-Eflow-API-Key: <INSERT API KEY>'
Response
{
	"conversion_id": "f9d3fa7e86d241afbec4a6c6c3fe2580",
	"conversion_unix_timestamp": 1661970244,
	"sub1": "facebook",
	"sub2": "",
	"sub3": "internal",
	"sub4": "",
	"sub5": "",
	"source_id": "",
	"revenue_type": "CPA",
	"revenue": 0.8,
	"session_user_ip": "217.66.156.135",
	"conversion_user_ip": "",
	"country": "Russia",
	"region": "Sankt-peterburg",
	"city": "St Petersburg",
	"dma": 0,
	"carrier": "MTS Russia",
	"platform": "macOS",
	"os_version": "",
	"device_type": "PC",
	"brand": "Apple",
	"browser": "Safari",
	"language": "en",
	"http_user_agent": "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_7_2 rv:5.0) Gecko/20111121 Firefox/5.0.1",
	"is_event": false,
	"event": "",
	"transaction_id": "a22f8a1b5fde4801a2ed3dceabf4f8a3",
	"click_unix_timestamp": 1661970238,
	"isp": "mts ojsc",
	"referer": "",
	"app_id": "",
	"idfa": "",
	"idfa_md5": "",
	"idfa_sha1": "",
	"google_ad_id": "",
	"google_ad_id_md5": "",
	"google_ad_id_sha1": "",
	"android_id": "",
	"android_id_md5": "",
	"android_id_sha1": "",
	"currency_id": "USD",
	"is_view_through": false,
	"order_id": "",
	"adv1": "",
	"adv2": "",
	"adv3": "",
	"adv4": "",
	"adv5": "",
	"relationship": {
		"offer": {
			"network_offer_id": 3,
			"network_id": 1,
			"name": "Daily Car",
			"offer_status": "active",
			"network_tracking_domain_id": 1
		},
		"events_count": 0
	}
}