Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: ip_address and user_agent should be in a single identifiers object. Error: At least one user identifier must be provided #3909

Open
amerkay opened this issue Dec 1, 2024 · 1 comment
Assignees

Comments

@amerkay
Copy link

amerkay commented Dec 1, 2024

Describe the bug
Error response from X: At least one user identifier must be provided.

Why it's happening: The ip_address and user_agent are placed at the conversion object level rather than combined identifier following the X docs.

See X Docs: https://developer.x.com/en/docs/x-ads-api/measurement/web-conversions/api-reference/conversions

From Docs:

IP address is required to be passed in conjunction with another identifier (twclid, email address, phone number or user agent).

User Agent is required to be passed in conjunction with another identifier (twclid, email address, phone number or IP address).
{
  "conversions":[
     {
        ...
        "identifiers":[
           {
              "ip_address":"1.0.0.0",
              "user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
           }
        ],
        ...
     }
  ]
}

To Reproduce
When I send ip_address and user_agent properties, this happens.

Payload:

{
    "version": "1",
    "type": "REST",
    "method": "POST",
    "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/oryuz",
    "headers": {
        "Authorization": "******1.0\"",
        "Content-Type": "application/json"
    },
    "params": {},
    "body": {
        "JSON": {
            "conversions": [
                {
                    "ip_address": "99.32.47.242",
                    "user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0",
                    "event_id": "tw-oryuz-os64j",
                    "conversion_time": "2024-12-01T20:39:43.240Z",
                    "identifiers": [
                        {
                            "hashed_email": "47c0c081d3916b87b3301ae04d29ca990eb8ce4c22b4fa53f0e25e4fb1583f58"
                        },
                        {
                            "ip_address": "99.32.47.242"
                        },
                        {
                            "user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0"
                        }
                    ]
                }
            ]
        },
        "JSON_ARRAY": {},
        "XML": {},
        "FORM": {}
    },
    "files": {}
}

Error response from Twitter:

{
  "response": "{\"errors\":[{\"code\":\"INVALID_PARAMETER\",\"message\":\"At least one user identifier must be provided\",\"parameter\":\"\"}],\"request\":{\"params\":{\"account_id\":\"18ce55453yk\"}}}",
  "firstAttemptedAt": "2024-12-01T20:39:59.109Z",
  "content-type": "application/json; charset=utf-8",
  "routerSubStage": "router_dest_delivery",
  "payloadStage": "router_input"
}

Expected behavior
ip_address and user_agent should be in a single object, not two separate ones:
{
"ip_address":"1.0.0.0",
"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
}

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
See:

if (message.properties.ip_address) {

@contributor-support
Copy link

Thanks for opening this issue! We'll get back to you shortly. If it is a bug, please make sure to add steps to reproduce the issue.

@amerkay amerkay changed the title BUG: BUG: ip_address and user_agent should be in a single identifiers object. Error: At least one user identifier must be provided Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants