Conversion API | Developer Center
日本語Reference
This page describes the reference and request samples for the conversion API.
Reference
Server | https://conversion-api.yahooapis.jp/v1 |
Request headers
Item name | Type | Required | Default value | Description |
---|---|---|---|---|
X-TagAccessToken | - | Yes | - | This is the access token obtained from the tracking tag management view in the Campaign Management Tool. |
Content-Type | - | Yes | - |
Format of sent data. |
Request body
Parameter name | Type | Required | Default value | Description | |||
---|---|---|---|---|---|---|---|
tag_id | string | Yes | - | Tag ID obtained from the tracking tag management view in the Campaign Management Tool. | |||
channel_id | long | Conditionally required | - | LINE channel ID. Required only when entering line_uid. | |||
Data | - | array | Yes | - | Store event data. The array limit is 1,000 items. |
||
event | event_type | string | Yes | - | Event type. | ||
event_snippet_id | string | - | Snippet ID. Required if "Event snippet" is selected in the "Filter" of the conversion setup. | ||||
event_time | long | Yes | - | Date and time of the conversion generated. Enter the date and time from 90 days before the request date to the current time in 10-digit UNIX time. If 13 digits are entered, ignore the last three digits and treat it as 10-digit UNIX time. If the request date is close to the current time, it may be adjusted by the API. | |||
action_source | string | Yes | - | Conversion source. You can specify only "web." | |||
test_flag | Bool | false | Flag indicating whether it is a test. true: Exclude from tracking as a test. false: Include in tracking. | ||||
transaction_id | string | - | A unique ID for duplicate detection in conversion tracking. Enter any string up to 64 characters. For duplicate exclusion, refer to "Conversion duplication exclusion." |
||||
user | hashed_phone_number | string | Conditionally required | - | Phone number hashed with SHA-256. Enter in international format using lowercase alphanumeric characters. Example: for a Japanese phone number like "090-0123-4567," change it to "+819001234567" and then hash it using SHA-256. At least one of the user parameters is required. |
||
hashed_email | string | - | Email address hashed with SHA-256. Enter using lowercase alphanumeric characters. Change to lowercase before hashing. At least one of the user parameters is required. |
||||
ly_su | string | - | Site user ID (unique identifier within the website's domain). The value of the Cookie "_ly_su." At least one of the user parameters is required. |
||||
ly_c | string | - | Click ID (identifier for users who clicked the ad). The value will be from the cookie or the "_ly_c" query parameter of the website URL. Since the URL parameter doesn't contain timestamp information, add the timestamp as follows: |
||||
ly_r | string | - | An ID that complements the accuracy of event tracking on the website's domain. The value will be from the cookie "_ly_r." At least one of the user parameters is required. |
||||
ifa | string | - | Advertising identifier. Enter either IDFA or AAID. Use uppercase for IDFA and lowercase for AAID. At least one of the user parameters is required. |
||||
line_uid | string | - | LINE user ID that identifies the user who generated the event. At least one of the user parameters is required. |
||||
web | url | string | - | URL of the browser when the event was generated. The available characters are as follows: ^http(s)?://.+ |
|||
referrer_url | string | - | Referrer of the browser when the event was generated. | ||||
user_agent | string | - | User agent of the browser used by the end user who generated the event. | ||||
ip | string | - | IP address of the end user who generated the event. You can specify both IPv4 and IPv6 addresses in this field. Use dotted decimal notation for IPv4 and follow the RFC 4291 format for IPv6. | ||||
custom | currency | string | Conditionally required | - | Currency unit. You can specify only "JPY." Required when entering a value. |
||
label | string | - | Custom label set as a filter when creating an audience list. For available characters and other details, refer to "Set custom labels for audience list." |
||||
value | float(64) | - | Value of the event. Enter a half-width number within the following range: 0 <= n < 10,000,000,000 |
||||
items | array | - | Store item information. The array limit is 10 items. You can't specify this when event_type is "page_view." |
||||
item_id | string | Conditionally required | - | Item ID. Enter using alphanumeric characters. Required if entering "price" or "quantity." When entering "price" or "quantity," either item_id or category_id is required. |
|||
category_id | string | - | Item type ID. Enter using alphanumeric characters. When entering "price" or "quantity," either item_id or category_id is required. |
||||
price | float(64) | - | Item price. Enter an integer in half-width digits within the following range: 0 <= n < 10,000,000,000 You can't enger if item_id is not present. |
||||
quantity | number | - | Item quantity. Enter an integer in half-width digits within the following range: 0 <= n < 2,147,483,647 You can't enter values with decimal points. You can't enter if item_id is missing. |
Event type
You can measure the following types of events with the conversion API.
Description | Event type |
---|---|
Page view | page_view |
Item list view | view_listing |
Item details view | view_product |
Viewing cart | view_cart |
Add to cart | add_cart |
Search | search |
Start checkout | check_out |
Purchase | purchase |
Generate leads | generate_lead |
Sign in | login |
Reservation complete | reservation |
Registration complete | sign_up |
Payment details | payment_info |
Add to wishlist | add_wishlist |
Request samples
$ curl \
-H "X-TagAccessToken: kiZ84ZoJyA4xz5hvcGiqOTZfVeZQa2p92uz-687" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"tag_id": "12345678-abcd-4bcd-1234-123456789012",
"channel_id": "1234567890",
"data": [
{
"event": {
"event_type": "page_view",
"event_snippet_id": "12345678-abcd-4bcd-1234-123456789012",
"event_time": 1700000000,
"action_source": "web",
"test_flag": false,
"transaction_id": "123"
},
"user": {
"hashed_phone_number": "4e6a6c5c6f8a086ce4babac3247364cc93a8a995a1968105d9b408f7e6b72e51",
"hashed_email": "31c5543c1734d25c7206f5fd591525d0295bec6fe84ff82f946a34fe970a1e66",
"ly_su": "1700000000.12345678-abcd-4bcd-1234-123456789012",
"ly_c": "1700000000.12345678-abcd-4bcd-1234-123456789012",
"ly_r": "1700000000.FF",
"ifa": "ABCDEF00-ABCD-4DEF-1234-1234567890AB",
"line_uid": "Ua1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p"
},
"web": {
"url": "https://www.yahoo.co.jp/?yj_r=FF&_ly_c=92aafe74-eae4-4130-975c-842a6f82df40&_ly_r=FF",
"referrer_url": "https://www.yahoo.co.jp",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/500.00 (KHTML, like Gecko) Chrome/50.0.0000.000 Safari/500.0",
"ip": "203.0.113.10"
},
"custom": {
"currency": "JPY",
"label": "label",
"value": 1000,
"items": [
{
"item_id": "1234567890",
"category_id": "1234567890",
"price": 10,
"quantity": 3
}
]
}
}
]
}' \
https://conversion-api.yahooapis.jp/v1/
Response
Results | Code | Description |
---|---|---|
Success | 202 | The request is successful. If the request is successful but contains invalid values or is considered a duplicate, it will be excluded from conversion tracking. |
Failed | 400 | Occurs when the request is invalid. This may occur if the request body can't be interpreted as JSON or if the input values are invalid. |
403 | Occurs if the authentication key is invalid or if a method other than POST is used for the request. | |
404 | Occurs if the request path is invalid. | |
415 | Occurs if the Content-Type specification is invalid. | |
429 | Occurs if the number of requests per second exceeds the request limit. | |
500 | Occurs if an internal error occurs. Try again. | |
503 | The API is unavailable due to maintenance or other reasons. |