Uploading offer events
Transmits data about offer events (Product Flow).
Usage example: You can send server-side (S2S) results of product scenarios via the Post API. For example, the final decision from a bank or insurance company after a pending status in the app.
For scenario examples, see Product flow examples.
Event properties can be passed in parameters or in the body of the request. When you pass data in the body, you should add .csv to the URL of the request. For more information, see Sample request.
To bind an event to a user, you should use one of the following fields in the API request:
profile_idappmetrica_device_id
Alert
The Post API has restrictions on loading data. For more information, see Restrictions.
Request format
POST https://api.appmetrica.yandex.com/logs/v1/import/product_flow
? post_api_key=<string>
& application_id=<int>
& profile_id=<string>
& appmetrica_device_id=<int>
& event_timestamp=<int>
& product_flow_type=<string>
& [product_offer_id=<string>]
& [product_id=<string>]
& [offer_type=<string>]
& [benefit_type=<string>]
& [referrer_type=<string>]
& [referrer_id=<string>]
& [referrer_screen=<string>]
& [step_type=<string>]
& [step_option=<string>]
& [result_status=<string>]
& [price_unit=<string>]
& [price_value=<decimal>]
& [payload=<string>]
& [session_type=<string>]
& [ios_ifa=<string>]
& [ios_ifv=<string>]
& [google_aid=<string>]
& [windows_aid=<string>]
& [os_name=<string>]
& [os_version=<string>]
& [device_manufacturer=<string>]
& [device_model=<string>]
& [device_type=<string>]
& [device_locale=<string>]
& [app_version_name=<string>]
& [app_package_name=<string>]
& [connection_type=<string>]
& [operator_name=<string>]
& [mcc=<int>]
& [mnc=<int>]
& [device_ipv6=<string>]
|
|
A token for data uploading. You can get it in the Settings section of your application. |
|
|
Unique numeric identifier for the application in AppMetrica. |
|
|
User profile ID. The Post API allows you only to upload data for identifiers that were previously sent via the SDK. Alert Do not pass this value together with the |
|
|
Hash from the unique identifier of the device set by AppMetrica. The Post API allows you only to upload data for identifiers that were previously sent via the SDK. Alert Do not pass this value together with the |
|
|
Time of the event in Unix time format. With the Post API, you can upload events only if the difference between the event date (event_timestamp) and the upload date is no more than 14 days. The API expects a value in seconds. |
|
|
Offer event type. Possible values:
|
|
|
Offer ID — a specific variant of the proposal. For example, a promo campaign or banner identifier. If the scenario started without an offer, you can omit this parameter. |
|
|
Product ID in the app. For example, a loan, subscription, or booking. Links events within the same scenario. |
|
|
Offer category. For example, |
|
|
Benefit type for the user. For example, |
|
|
Referrer type for the offer. For example, |
|
|
Referrer ID. For example, a banner or push campaign identifier. |
|
|
Screen where the user saw the offer or started the flow. For example, |
|
|
Name of an intermediate flow step. For example, |
|
|
Step details. For example, |
|
|
Scenario outcome. Passed with
For more information about statuses, see Product flow examples. |
|
|
Currency of the offer price or final scenario amount. List of available currencies. Pass together with |
|
|
Amount in the |
|
|
Additional scenario parameters in a |
|
|
Session type. Possible values:
Default value: |
|
|
The device's IFA in the format received from the device. |
|
|
IFV for the app in the format received from the device. |
|
|
The device's Google AID in the format received from the device. |
|
|
The device's Windows AID in the format received from the device. |
|
|
Operating system on the user's device: |
|
|
The version of the operating system on the user's device. |
|
|
The device manufacturer detected by the AppMetrica service (for example, Apple or Samsung). |
|
|
The device model detected by the AppMetrica service (for example, Galaxy S6). |
|
|
The device type detected by the AppMetrica service. Possible values: |
|
|
The language on the device. |
|
|
The app version in the format specified by the developer. |
|
|
The package name for Android, or the Bundle ID for iOS (for example, ru.yandex.metro). |
|
|
Type of connection. Possible values: |
|
|
Name of the mobile operator. |
|
|
Mobile country code. |
|
|
Mobile network code. |
|
|
The IP address at the time of the event in IPv6 format. For example, 2a02:6b8::40c:6676:baff:fea6:53d8, ::ffff:5.255.232.147. |
Response codes
| Code | Description |
|---|---|
| 200 | The data has been uploaded successfully. |
| 403 | The request does not contain an authorization header, or the token is invalid. |
| 400 | The request does not contain one or more required parameters. |
Sample request
POST /logs/v1/import/product_flow.csv?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012 HTTP/1.1
Host: api.appmetrica.yandex.com
Connection: close
application_id,appmetrica_device_id,event_timestamp,product_flow_type,product_offer_id,product_id,result_status,price_unit,price_value,payload,session_type
1234567890,1757762239877245682,1689943892,flow_result,credit_q1,personal_loan,success,RUB,123.45,"{""request_id"":""loan-42""}",background
POST /logs/v1/import/product_flow?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012&application_id=1234567890&appmetrica_device_id=1757762239877245682&event_timestamp=1689943892&product_flow_type=flow_result&product_offer_id=credit_q1&product_id=personal_loan&result_status=success&price_unit=RUB&price_value=123.45&payload="{""request_id"":""loan-42""}"&session_type=background HTTP/1.1
Host: api.appmetrica.yandex.com
Content-Length: 0
Connection: close
Other Post API methods
- Uploading events
- Uploading In-App Revenue events
- Uploading Ad Revenue events
- Uploading E-commerce events
- Profile attributes
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.