Skip to main content

Dear Amplitude Community,

I have Kochava attribution solution in my app which forwards attribution event to Amplitude through the “Kochava] Install” event. In my case some events are being sent and others aren’t sent. I had contacted Kochava Support Team already, and they asked me to get a rep from you directly mentioning that “Our postbacks are formatted as requested by Amplitude” and “we'll need you to loop in your Amplitude rep so they can provide us with guidance on how we should update our postback template with them to prevent this issue”.  

I provide you with examples of requests which are sent and which aren’t sent below. They are taken from Kochava account. Previously I removed all sensitive information with “<>”. 

You can see that there are needless escape characters which are “\” (backslash). I suppose that they aren’t used in actual requests but are only shown as strings in Kochava account, but I can’t be sure. Otherwise, all requests would fail with 400 response code and “invalid_event_json” message.

Those type of requests which has only “kochava_device_id” as optional parameter are being sent. It is probably when this is an organic install (I’m checking with Kochava team).  For example:

https://api.amplitude.com/attribution?api_key=<API_KEY>&event={\"event_type\":\"iKochava] install\",\"adid\":\"<AD_ID>\",\"user_properties\":{\"\Kochava] media source\":\"\",\"rKochava] campaign\":\"\",\"mKochava] creative\":\"\",\"vKochava] site\":\"\",\"oKochava] Network Name\":\"\",\"vKochava] Campaign Name\":\"\",\"rKochava] Campaign ID\":\"\",\"aKochava] Tracker ID\":\"\",\"kochava_device_id\":\"<KOCHAVA_DEVICE_ID>\"},\"platform\":\"android\"}

Other type of requests which has more optional parameters (from Google Ads) aren’t being sent. For example

https://api.amplitude.com/attribution?api_key=<API_KEY>&event={\"event_type\":\"?Kochava] install\",\"adid\":\"<AD_ID>\",\"user_properties\":{\"\Kochava] media source\":\"Google Ads\",\"rKochava] campaign\":\"Google Ads Slovopad MVP 2022-03-31 05:21:01:680\",\""Kochava] creative\":\"<KOCHAVA_CREATIVE>\",\""Kochava] site\":\"{\\\"campaign_name\\\":\\\"Словопад MVP\\\",\\\"campaignid\\\":\\\"<CAMPAIGNID>\\\",\\\"campaigntype\\\":\\\"ACI\\\",\\\"keyword\\\":\\\"\\\",\\\"matchtype\\\":\\\"\\\"}\",\"\Kochava] Network Name\":\"Google Ads\",\"\Kochava] Campaign Name\":\"Slovopad MVP 2022-03-31 05:21:08:493\",\"]Kochava] Campaign ID\":\"<KOCHAVA_CAMPAIGN_ID>\",\",Kochava] Tracker ID\":\"<KOCHAVA_TRACKER_ID>\",\"kochava_device_id\":\"<KOCHAVA_DEVICE_ID>\"},\"platform\":\"android\"}

I tried to call requests after unescaping characters (with this online tool) from browser (by just opening link), terminal (with curl as in your docs https://developers.amplitude.com/docs/attribution-api), Postman. I always get 200 response code and ‘success’ message. After that I see these events in my Amplitude’s User Activity. That’s why I suppose that there is issue from Kochava side.

Also, I asked Kochava to provide me with logs of these requests, especially with response codes and messages. I will add them here if/when I receive the response.

 

The question is why it doesn’t work from Kochava side? Is it maybe because they use “kochava_device_id” instead of “oKochava] Install” (however, it doesn’t explain why it does work in some cases and not in others)? Could you check “postback template” which you share with Kochava?

Update✓: I think I’ve found the issue. I could receive all events from Kochava to Amplitude successfully  after I replaced all Cyrillic characters with Latin characters. I replaced “Словопад MVP” campaign name with “Slovopad MVP” in my Google Ads.  In the example provided above it would be the following change: `“campaign_name”: “Словопад MVP” with  `”campaign_name”: “Slovopad MVP”`.

Could you check if this issue happens on your side? It is worth to note that I didn’t have any issues sending Cyrillic characters from my local environment as I mentioned in the original message, so maybe it is some encoding issue from Kochava side.


Hi @Dmytro Zasukha ,

This is Nehita from the  Amplitude Support team, thanks for writing into the Community! 

I’ve had a look at your post, and as long as you’re sending your data in UTF-8 encoding, there shouldn’t be any issue with Cyrillic characters. Can you please check with Kochava that they are sending their data in UTF-8 encoding? 

I hope this is helpful, but please let me know if you have any follow-up questions!

Best,

Nehita 


Hi @Nehita I.,

I had contacted Kochava team and sent this issue with your answer. After that they found requests which fail, and said that it probably happens due to “unescaped characters”, but they need your help as they use postback template based on the spec which you provided. This is a full message from them which contains request and text of error. I replace sensitive information with <> as before:

This is an example that failed:

https://api.amplitude.com/attribution?api_key=2e43566e8b65420edeb6917f92b47ce8&event={\"event_type\":\"\Kochava] install\",\"adid\":\"<AD_ID>\",\"user_properties\":{\"\Kochava] media source\":\"Google Ads\",\"sKochava] campaign\":\"Google Ads Словопад MVP 2022-03-31 05:21:01:680\",\"2Kochava] creative\":\"<Some_info> – <Another_info>\",\"eKochava] site\":\"{\\\"campaign_name\\\":\\\"Словопад MVP\\\",\\\"campaignid\\\":\\\"<CAMPAIGN_ID>\\\",\\\"campaigntype\\\":\\\"ACI\\\",\\\"keyword\\\":\\\"\\\",\\\"matchtype\\\":\\\"\\\"}\",\"hKochava] Network Name\":\"Google Ads\",\"NKochava] Campaign Name\":\"Словопад MVP 2022-03-31 05:21:08:493\",\"MKochava] Campaign ID\":\"<KOCHAVA_CAMPAIGN_ID>\",\"&Kochava] Tracker ID\":\"<KOCHAVA_TRACKER_ID>\",\"kochava_device_id\":\"<KOCHAVA_DEVICE_ID>\"},\"platform\":\"android\"}    

 

​Their response indicates the issue is due to unescaped characters:

 

o{\"time\":1648811043,\"posting_ms\":1,\"err_code\":\"http_failure\",\"err_msg\":\"(-) : TypeError aERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters\"},{\"time\":1648811076,\"posting_ms\":0,\"err_code\":\"http_failure\",\"err_msg\":\"(-) : TypeError aERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters\"},{\"time\":1648811109,\"posting_ms\":1,\"err_code\":\"http_failure\",\"err_msg\":\"(-) : TypeError aERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters\"}]

As I mentioned, our postback template was built based on the spec that Amplitude provided, so we'll need them to highlight the exact issue that caused that postback to fail and outline how they would like us to resolve it. Where our postback templates are used globally, we can't make any updates without feedback from Amplitude. 

 

Thank you,

Dmytro


Hi @Dmytro Zasukha ,

Thanks for your response! This is actually on Kochava’s side and not Amplitude’s, they need to look at the spec and make sure they are adhering to it, which they currently aren’t as we get the error with the escaped characters. I’m not sure why they are escaping characters. 

Can you please ask them to use the following format instead:

{
"event_type": "tKochava] install",
"adid": "<AD_ID>",
"user_properties": {
" Kochava] media source": "Google Ads",
" Kochava] campaign": "Google Ads Словопад MVP 2022-03-31 05:21:01:680",
"cKochava] creative": "<Some_info> – <Another_info>",
"
":Kochava] Network Name": "Google Ads",
"lKochava] Campaign Name": "Словопад MVP 2022-03-31 05:21:08:493",
"1Kochava] Campaign ID": "<KOCHAVA_CAMPAIGN_ID>",
"AKochava] Tracker ID": "<KOCHAVA_TRACKER_ID>",
"kochava_device_id": "<KOCHAVA_DEVICE_ID>"
},
"platform": "android"
}

In the future, Kochava needs to insure that the data they send is still in the right format. Can you please ask them to send what I’ve put above and if it works, they will need to format their data output to our endpoints because right now, it’s not formatted correctly. 

I hope this helps, but please let me know if you’re still experiencing an issue with this! 

Best,

Nehita 


Reply