Skip to content

Migrate Segment Amazon Conversion connector to CAPI v2 open beta API#3550

Open
bansrav wants to merge 3 commits intosegmentio:mainfrom
bansrav:main
Open

Migrate Segment Amazon Conversion connector to CAPI v2 open beta API#3550
bansrav wants to merge 3 commits intosegmentio:mainfrom
bansrav:main

Conversation

@bansrav
Copy link
Contributor

@bansrav bansrav commented Jan 29, 2026

A summary of your pull request, including the what change you're making and why.

Amazon Conversions API currently uses CAPI v2 closed beta end-point. We need to migrate the plug-in to CAPI v2 open beta end-point - see API Spec for CAPI v2 open beta. There is a difference in the end-point and the field mapping / names in closed beta and open beta API. In this PR, I am migrating the Segment connector to use open beta API which is our north star API for advertisers event ingestion.

Testing

Tested both sync and async/batch in local in postman. Here are the testing results:

Sync invocation

Segment API Request

{
  "settings": {
    "region": "https://advertising-api.amazon.com",
    "advertiserId": "584745631404987135"
  },
  "auth": {
    "accessToken": "redacted",
    "refreshToken":"redacted"
  },
  "payload":
    {
  "messageId": "test-message-mhq0fccosl",
  "timestamp": "2025-05-27T23:39:43.760Z",
  "type": "track",
  "email": "[email protected]",
  "properties": {
    "property1": 1,
    "property2": "test",
    "property3": true,
    "eventType":"OFF_AMAZON_PURCHASES",
    "currency":"USD",
    "quantity":1,
    "dataProcessingOptions":[
      "LIMITED_DATA_USE"
  ],
    "brand":"Apple",
    "category":"iPhone",
    "productId":"iPhone 17 pro max",
    "attr1":"6.7",
    "attr8":"4.5",
    "amznAdStorage":"GRANTED",
    "tcf":"test tcf",
    "gpp":"test gpp"
  },
  "userId": "test-user-isd6e0dogb",
  "event": "Segment Test Event Name",
  "anonymousId": "q8oypo7l8i",
  "context": {
      "ip":"0.0.0.1",
    "active": true,
    "app": {
      "name": "InitechGlobal",
      "version": "545",
      "build": "3.0.1.545",
      "namespace": "com.production.segment"
    },
    "campaign": {
      "name": "TPS Innovation Newsletter",
      "source": "Newsletter",
      "medium": "email",
      "term": "tps reports",
      "content": "image link"
    },
    "device": {
      "id": "B5372DB0-C21E-11E4-8DFC-AA07A5B093DB",
      "advertisingId": "7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB",
      "adTrackingEnabled": true,
      "manufacturer": "Apple",
      "model": "iPhone7,2",
      "name": "maguro",
      "token": "ff15bc0c20c4aa6cd50854ff165fd265c838e5405bfeb9571066395b8c9da449"
    },
    "library": {
      "name": "analytics.js",
      "version": "2.11.1"
    },
    "locale": "en-US",
    "location": {
      "city": "San Francisco",
      "country": "United States",
      "latitude": 40.2964197,
      "longitude": -76.9411617,
      "speed": 0
    },
    "network": {
      "bluetooth": false,
      "carrier": "T-Mobile US",
      "cellular": true,
      "wifi": false
    },
    "os": {
      "name": "iPhone OS",
      "version": "8.1.3"
    },
    "page": {
      "path": "/academy/",
      "referrer": "",
      "search": "",
      "title": "Analytics Academy",
      "url": "https://segment.com/academy/"
    },
    "referrer": {
      "id": "ABCD582CDEFFFF01919",
      "type": "dataxu"
    },
    "screen": {
      "width": 320,
      "height": 568,
      "density": 2
    },
    "groupId": "12345",
    "timezone": "Europe/Amsterdam",
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
  },
  "receivedAt": "2025-05-27T23:39:43.760Z",
  "sentAt": "2025-05-27T23:39:43.760Z",
  "version": 2
}
}

Segment API Response

[
    {
        "request": {
            "url": "https://advertising-api.amazon.com/adsApi/v1/create/events",
            "method": "POST",
            "headers": {
                "amazon-ads-accountid": "584745631404987135",
                "amazon-ads-clientid": "redacted",
                "authorization": "<redacted>",
                "content-type": "application/json",
                "user-agent": "Segment (Actions)"
            },
            "body": "{\"events\":[{\"eventDescription\":{\"name\":\"Segment Test Event Name\",\"conversionType\":\"OFF_AMAZON_PURCHASES\",\"eventSource\":\"WEBSITE\",\"eventIngestionMethod\":\"SERVER_TO_SERVER\"},\"countryCode\":\"US\",\"eventTime\":\"2025-05-27T23:39:43.760Z\",\"matchKeys\":[{\"type\":\"MAID\",\"values\":[\"7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB\"]}],\"currencyCode\":\"USD\",\"unitsSold\":1,\"eventId\":\"test-message-mhq0fccosl\",\"dataProcessingOptions\":{\"options\":\"LIMITED_DATA_USE\"},\"consent\":{\"geo\":{\"ipAddress\":\"0.0.0.1\"},\"tcf\":\"test tcf\",\"gpp\":\"test gpp\"},\"customData\":[{\"name\":\"brand\",\"value\":\"Apple\"},{\"name\":\"category\",\"value\":\"iPhone\"},{\"name\":\"productId\",\"value\":\"iPhone 17 pro max\"},{\"name\":\"attr1\",\"value\":\"6.7\"},{\"name\":\"attr8\",\"value\":\"4.5\"}]}]}"
        },
        "response": {
            "statusCode": 207,
            "statusMessage": "Multi-Status",
            "headers": {
                "connection": "close",
                "content-length": "934",
                "content-type": "application/json",
                "date": "Wed, 28 Jan 2026 23:28:14 GMT",
                "server": "Server",
                "strict-transport-security": "max-age=47474747; includeSubDomains; preload",
                "vary": "Content-Type,Accept-Encoding,User-Agent",
                "x-amz-apigw-id": "X60-LEuFoAMFqxw=",
                "x-amz-rid": "KZAQYWE389TTHDDBXZN5",
                "x-amzn-remapped-content-length": "934",
                "x-amzn-remapped-date": "Wed, 28 Jan 2026 23:28:14 GMT",
                "x-amzn-remapped-server": "Apache-Coyote/1.1",
                "x-amzn-remapped-x-amzn-requestid": "fd015940-7b99-4cfc-8b5c-560c7c2b8cbd",
                "x-amzn-requestid": "fd015940-7b99-4cfc-8b5c-560c7c2b8cbd",
                "x-amzn-trace-id": "Root=1-697a9b8e-87040bc03a0ccd8ce88c9482"
            },
            "body": {
                "error": [],
                "success": [
                    {
                        "event": {
                            "amazonAdEventKey": null,
                            "consent": {
                                "amazonConsent": null,
                                "geo": {
                                    "ipAddress": "0.0.0.1"
                                },
                                "gpp": "test gpp",
                                "tcf": "test tcf"
                            },
                            "countryCode": "US",
                            "currencyCode": "USD",
                            "customData": [
                                {
                                    "dataType": "STRING",
                                    "name": "brand",
                                    "value": "Apple"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "category",
                                    "value": "iPhone"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "productId",
                                    "value": "iPhone_17_pro_max"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "attr1",
                                    "value": "6_7"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "attr8",
                                    "value": "4_5"
                                }
                            ],
                            "dataProcessingOptions": {
                                "options": "LIMITED_DATA_USE"
                            },
                            "eventDescription": {
                                "conversionType": "OFF_AMAZON_PURCHASES",
                                "dataSetName": null,
                                "eventIngestionMethod": "SERVER_TO_SERVER",
                                "eventSource": "WEBSITE",
                                "name": "Segment Test Event Name"
                            },
                            "eventId": "test-message-mhq0fccosl",
                            "eventTime": "2025-05-27T23:39:43.760Z",
                            "matchKeys": [
                                {
                                    "type": "MAID",
                                    "values": [
                                        "7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB"
                                    ]
                                }
                            ],
                            "partner": null,
                            "unitsSold": 1,
                            "value": null
                        },
                        "index": 0
                    }
                ]
            }
        }
    }
]

Async / Batch invocation

Segment API Request

{
  "settings": {
    "region": "https://advertising-api.amazon.com",
    "advertiserId": "584745631404987135"
  },
  "auth": {
    "accessToken": "redacted",
    "refreshToken":"redacted"
  },
  "payload":
   [ {
  "messageId": "test-message-mhq0fccosl",
  "timestamp": "2025-05-27T23:39:43.760Z",
  "type": "track",
  "email": "[email protected]",
  "properties": {
      "value":0.1,
    "property1": 1,
    "property2": "test",
    "property3": true,
    "eventType":"OFF_AMAZON_PURCHASES",
    "currency":"USD",
    "quantity":1,
    "brand":"Apple",
    "category":"iPhone",
    "productId":"iPhone 17 pro max",
    "attr1":"6.7",
    "attr8":"4.5",
    "amznAdStorage":"GRANTED",
    "tcf":"test tcf",
    "gpp":"test gpp"
  },
  "userId": "test-user-isd6e0dogb",
  "event": "Segment Test Event Name",
  "anonymousId": "q8oypo7l8i",
  "context": {
      "ip":"0.0.0.1",
    "active": true,
    "app": {
      "name": "InitechGlobal",
      "version": "545",
      "build": "3.0.1.545",
      "namespace": "com.production.segment"
    },
    "campaign": {
      "name": "TPS Innovation Newsletter",
      "source": "Newsletter",
      "medium": "email",
      "term": "tps reports",
      "content": "image link"
    },
    "device": {
      "id": "B5372DB0-C21E-11E4-8DFC-AA07A5B093DB",
      "advertisingId": "7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB",
      "adTrackingEnabled": true,
      "manufacturer": "Apple",
      "model": "iPhone7,2",
      "name": "maguro",
      "token": "ff15bc0c20c4aa6cd50854ff165fd265c838e5405bfeb9571066395b8c9da449"
    },
    "library": {
      "name": "analytics.js",
      "version": "2.11.1"
    },
    "locale": "en-US",
    "location": {
      "city": "San Francisco",
      "country": "United States",
      "latitude": 40.2964197,
      "longitude": -76.9411617,
      "speed": 0
    },
    "network": {
      "bluetooth": false,
      "carrier": "T-Mobile US",
      "cellular": true,
      "wifi": false
    },
    "os": {
      "name": "iPhone OS",
      "version": "8.1.3"
    },
    "page": {
      "path": "/academy/",
      "referrer": "",
      "search": "",
      "title": "Analytics Academy",
      "url": "https://segment.com/academy/"
    },
    "referrer": {
      "id": "ABCD582CDEFFFF01919",
      "type": "dataxu"
    },
    "screen": {
      "width": 320,
      "height": 568,
      "density": 2
    },
    "groupId": "12345",
    "timezone": "Europe/Amsterdam",
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
  },
  "receivedAt": "2025-05-27T23:39:43.760Z",
  "sentAt": "2025-05-27T23:39:43.760Z",
  "version": 2
},
{
  "messageId": "test-message-mhq0fccosl",
  "timestamp": "2025-05-27T23:39:43.760Z",
  "type": "track",
  "email": "[email protected]",
  "properties": {
      "value":-0.1,
    "property1": 1,
    "property2": "test",
    "property3": true,
    "eventType":"OFF_AMAZON_PURCHASES",
    "currency":"USD",
    "quantity":1,
    "dataProcessingOptions":[
      "LIMITED_DATA_USE"
  ],
    "brand":"Apple",
    "category":"iPhone",
    "productId":"iPhone 17 pro max",
    "attr1":"6.7",
    "attr8":"4.5",
    "amznAdStorage":"GRANTED",
    "tcf":"test tcf",
    "gpp":"test gpp"
  },
  "userId": "test-user-isd6e0dogb",
  "event": "Segment Test Event Name",
  "anonymousId": "q8oypo7l8i",
  "context": {
      "ip":"0.0.0.1",
    "active": true,
    "app": {
      "name": "InitechGlobal",
      "version": "545",
      "build": "3.0.1.545",
      "namespace": "com.production.segment"
    },
    "campaign": {
      "name": "TPS Innovation Newsletter",
      "source": "Newsletter",
      "medium": "email",
      "term": "tps reports",
      "content": "image link"
    },
    "device": {
      "id": "B5372DB0-C21E-11E4-8DFC-AA07A5B093DB",
      "advertisingId": "7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB",
      "adTrackingEnabled": true,
      "manufacturer": "Apple",
      "model": "iPhone7,2",
      "name": "maguro",
      "token": "ff15bc0c20c4aa6cd50854ff165fd265c838e5405bfeb9571066395b8c9da449"
    },
    "library": {
      "name": "analytics.js",
      "version": "2.11.1"
    },
    "locale": "en-US",
    "location": {
      "city": "San Francisco",
      "country": "United States",
      "latitude": 40.2964197,
      "longitude": -76.9411617,
      "speed": 0
    },
    "network": {
      "bluetooth": false,
      "carrier": "T-Mobile US",
      "cellular": true,
      "wifi": false
    },
    "os": {
      "name": "iPhone OS",
      "version": "8.1.3"
    },
    "page": {
      "path": "/academy/",
      "referrer": "",
      "search": "",
      "title": "Analytics Academy",
      "url": "https://segment.com/academy/"
    },
    "referrer": {
      "id": "ABCD582CDEFFFF01919",
      "type": "dataxu"
    },
    "screen": {
      "width": 320,
      "height": 568,
      "density": 2
    },
    "groupId": "12345",
    "timezone": "Europe/Amsterdam",
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1"
  },
  "receivedAt": "2025-05-27T23:39:43.760Z",
  "sentAt": "2025-05-27T23:39:43.760Z",
  "version": 2
}]
}

Async / Batch API Response

[
    {
        "request": {
            "url": "https://advertising-api.amazon.com/adsApi/v1/create/events",
            "method": "POST",
            "headers": {
                "amazon-ads-accountid": "584745631404987135",
                "amazon-ads-clientid": "redacted",
                "authorization": "<redacted>",
                "content-type": "application/json",
                "user-agent": "Segment (Actions)"
            },
            "body": "{\"events\":[{\"eventDescription\":{\"name\":\"Segment Test Event Name\",\"conversionType\":\"OFF_AMAZON_PURCHASES\",\"eventSource\":\"WEBSITE\",\"eventIngestionMethod\":\"SERVER_TO_SERVER\"},\"countryCode\":\"US\",\"eventTime\":\"2025-05-27T23:39:43.760Z\",\"matchKeys\":[{\"type\":\"MAID\",\"values\":[\"7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB\"]}],\"value\":0.1,\"currencyCode\":\"USD\",\"unitsSold\":1,\"eventId\":\"test-message-mhq0fccosl\",\"consent\":{\"geo\":{\"ipAddress\":\"0.0.0.1\"},\"tcf\":\"test tcf\",\"gpp\":\"test gpp\"},\"customData\":[{\"name\":\"brand\",\"value\":\"Apple\"},{\"name\":\"category\",\"value\":\"iPhone\"},{\"name\":\"productId\",\"value\":\"iPhone 17 pro max\"},{\"name\":\"attr1\",\"value\":\"6.7\"},{\"name\":\"attr8\",\"value\":\"4.5\"}]},{\"eventDescription\":{\"name\":\"Segment Test Event Name\",\"conversionType\":\"OFF_AMAZON_PURCHASES\",\"eventSource\":\"WEBSITE\",\"eventIngestionMethod\":\"SERVER_TO_SERVER\"},\"countryCode\":\"US\",\"eventTime\":\"2025-05-27T23:39:43.760Z\",\"matchKeys\":[{\"type\":\"MAID\",\"values\":[\"7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB\"]}],\"value\":-0.1,\"currencyCode\":\"USD\",\"unitsSold\":1,\"eventId\":\"test-message-mhq0fccosl\",\"dataProcessingOptions\":{\"options\":\"LIMITED_DATA_USE\"},\"consent\":{\"geo\":{\"ipAddress\":\"0.0.0.1\"},\"tcf\":\"test tcf\",\"gpp\":\"test gpp\"},\"customData\":[{\"name\":\"brand\",\"value\":\"Apple\"},{\"name\":\"category\",\"value\":\"iPhone\"},{\"name\":\"productId\",\"value\":\"iPhone 17 pro max\"},{\"name\":\"attr1\",\"value\":\"6.7\"},{\"name\":\"attr8\",\"value\":\"4.5\"}]}]}"
        },
        "response": {
            "statusCode": 207,
            "statusMessage": "Multi-Status",
            "headers": {
                "connection": "close",
                "content-length": "1042",
                "content-type": "application/json",
                "date": "Thu, 22 Jan 2026 01:50:42 GMT",
                "server": "Server",
                "strict-transport-security": "max-age=47474747; includeSubDomains; preload",
                "vary": "Content-Type,Accept-Encoding,User-Agent",
                "x-amz-apigw-id": "XkFR1E5woAMFxaw=",
                "x-amz-rid": "KS7ZF3RYY5RKN0QSFQNW",
                "x-amzn-remapped-connection": "close",
                "x-amzn-remapped-content-length": "1042",
                "x-amzn-remapped-date": "Thu, 22 Jan 2026 01:50:42 GMT",
                "x-amzn-remapped-server": "Apache-Coyote/1.1",
                "x-amzn-remapped-x-amzn-requestid": "e5cd312f-cef4-40ef-b10f-d3e281d3216c",
                "x-amzn-requestid": "e5cd312f-cef4-40ef-b10f-d3e281d3216c",
                "x-amzn-trace-id": "Root=1-69718272-98c95a0b969a75924faa2512"
            },
            "body": {
                "error": [
                    {
                        "errors": [
                            {
                                "code": "BAD_REQUEST",
                                "fieldLocation": "value",
                                "message": "Value -0.1 must be between [0.0, 9.99999999999999E12]"
                            }
                        ],
                        "index": 1
                    }
                ],
                "success": [
                    {
                        "event": {
                            "amazonAdEventKey": null,
                            "consent": {
                                "amazonConsent": null,
                                "geo": {
                                    "ipAddress": "0.0.0.1"
                                },
                                "gpp": "test gpp",
                                "tcf": "test tcf"
                            },
                            "countryCode": "US",
                            "currencyCode": "USD",
                            "customData": [
                                {
                                    "dataType": "STRING",
                                    "name": "brand",
                                    "value": "Apple"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "category",
                                    "value": "iPhone"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "productId",
                                    "value": "iPhone_17_pro_max"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "attr1",
                                    "value": "6_7"
                                },
                                {
                                    "dataType": "STRING",
                                    "name": "attr8",
                                    "value": "4_5"
                                }
                            ],
                            "dataProcessingOptions": null,
                            "eventDescription": {
                                "conversionType": "OFF_AMAZON_PURCHASES",
                                "dataSetName": null,
                                "eventIngestionMethod": "SERVER_TO_SERVER",
                                "eventSource": "WEBSITE",
                                "name": "Segment Test Event Name"
                            },
                            "eventId": "test-message-mhq0fccosl",
                            "eventTime": "2025-05-27T23:39:43.760Z",
                            "matchKeys": [
                                {
                                    "type": "MAID",
                                    "values": [
                                        "7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB"
                                    ]
                                }
                            ],
                            "partner": null,
                            "unitsSold": 1,
                            "value": 0.1
                        },
                        "index": 0
                    }
                ]
            }
        }
    }
]

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Security Review

Please ensure sensitive data is properly protected in your integration.

  • Reviewed all field definitions for sensitive data (API keys, tokens, passwords, client secrets) and confirmed they use type: 'password'

New Destination Checklist

  • Extracted all action API versions to verioning-info.ts file. example

required: false,
defaultObjectUI: 'keyvalue',
additionalProperties: true,
additionalProperties: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is intentional to limit the custom attributes to max 13 as Amazon API supports only 13 fields.

@joe-ayoub-segment
Copy link
Contributor

Hello @bansrav good to hear from you, and thanks for raising this PR!

This PR introduces breaking changes, because there are new, required fields being defined. Renaming a field is the same as defining a new field.

So we have a choice to make. Do we deploy this code over the code which is currently live, which will break data collection for customers who are already using the integration? Or do we register this code as a new integration, and leave customers on the old 'closed beta' version, and let them migrate over in their own time.

It was a while since we last discussed this in person, so worth asking again. I'm OK with whichever approach you want to go for, but if we go for the first option we need to reach out to customers first.

Kind regards,
Joe

* A list of flags for signaling how an event shall be processed. Events marked for limited data use will not be processed.
*/
dataProcessingOptions?: string[]
dataProcessingOptions?: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bansrav - converting this to a string (from a string array) is likely to break things for customers who are already passing string arrays.

Is this type change absolutely needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the comment. In the UI today, we have bounded value for this array which is choices: [{ label: 'Limited Data Use', value: 'LIMITED_DATA_USE' }],. Can customers pass multiple values in it? I didn't find a way to pass multiple values. Let me know if I am missing something.

In existing Amazon Conversions API spec, this field is modeled as below so even if any customer is passing multiple values today, the request validation on Amazon side will throw 400 error due to maxItem constraint.


dataProcessingOptions:
--
  |   | type: array
  |   | minItems: 0
  |   | maxItems: 1
  |   | items:
  |   | type: string
  |   | enum:
  |   | - LIMITED_DATA_USE

In the new CAPI v2 open beta spec, this field is modeled as object shown below which means there is no way to accept multiple values and if customer even pass multiple value, we have to choose the first one and pass it to Amazon API.

"dataProcessingOptions": {
        "options": "LIMITED_DATA_USE"
      },

If we keep this field modeled as array in UI, I feel that this gives bad customer experience as customers might complaint that we are passing multiple values, but on Amazon side, only one value is present so I thought to simplify this field mapping in UI.

Let me know your thoughts.

Copy link
Contributor

@joe-ayoub-segment joe-ayoub-segment Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining @bansrav - that makes sense.

Do you know if this field is intended to evolve so that additional values could be passed? How likely is it that you might need to set more than 1 value at the same time for this field?

I'm not sure if converting the field from a string[] to string will cause a validation error in the pipeline (for existing customers). We should check this.

alternatively, we could delete this field and add a new optional field. Then in code you could default to LIMITED_DATA_USE if no value is provided. I think this might be the simplest approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if this field is intended to evolve so that additional values could be passed? How likely is it that you might need to set more than 1 value at the same time for this field?

This field is not expected to evolve and the usages of this field will be very limited today. I don't think any advertiser uses it at all because the meaning of LIMITED_DATA_USE is to ignore the event on our side from processing. It's like advertiser send Amazon the event but ask to ignore it. I don't think any advertiser is using it today.

I'm not sure if converting the field from a string[] to string will cause a validation error in the pipeline (for existing customers). We should check this.

Not sure how I can validate it on my side. I have tested the changes in my local though.

alternatively, we could delete this field and add a new optional field. Then in code you could default to LIMITED_DATA_USE if no value is provided. I think this might be the simplest approach.

No, we shouldn't be creating new field and by default populate LIMITED_DATA_USE. As I described above, the meaning of this field is to completely ignore the event for processing.

I feel you are reluctant to change the data type from string[] to string for backward compatibility which makes sense and to fix it, I have reverted this change now in latest commit. Basically, we still accept as array but while mapping the payload to amazon API spec, I use the 0th index element.
Can you please review the latest code changes?

Copy link
Contributor

@joe-ayoub-segment joe-ayoub-segment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bansrav please look at my comment regarding the dataProcessingOptions field being changed from string[] to string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants