I have a production bug that I am seeing for the K...
# support
t
I have a production bug that I am seeing for the Klaviyo destination. We are seeing an extra PATCH call going to them for some reason when we expect only a single one. A single
identify
call is ending up sending two events to klaviyo. You'll see this is an array of 2 events. The first is expected but the second is not as it's not patching anything. So it seems like there is a bug here with the destination. It's causing issues on klaviyo's side in certain cases as it's stomping properties in our user profiles. This may be a special case where we have identify calls that are modified by a transformation that drops all traits EXCEPT EMAIL and properties.subscribe.
Copy code
[
    {
        "version": "1",
        "type": "REST",
        "method": "POST",
        "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs",
        "headers": {
            "Authorization": "Klaviyo-API-Key xxxhiddenxxx",
            "Content-Type": "application/json",
            "Accept": "application/json",
            "revision": "2023-02-22"
        },
        "params": {},
        "body": {
            "JSON": {
                "data": {
                    "type": "profile-subscription-bulk-create-job",
                    "attributes": {
                        "list_id": "SN6fp6",
                        "subscriptions": [
                            {
                                "email": "chrisb+one@bigcartel.com",
                                "channels": {
                                    "email": [
                                        "MARKETING"
                                    ]
                                }
                            }
                        ]
                    }
                }
            },
            "JSON_ARRAY": {},
            "XML": {},
            "FORM": {}
        },
        "files": {}
    },
    {
        "version": "1",
        "type": "REST",
        "method": "PATCH",
        "endpoint": "https://a.klaviyo.com/api/profiles/01HGXXREVZ9NAJ8TPKMSE39HH1",
        "headers": {
            "Authorization": "Klaviyo-API-Key xxxxxxx",
            "Content-Type": "application/json",
            "Accept": "application/json",
            "revision": "2023-02-22"
        },
        "params": {},
        "body": {
            "JSON": {
                "data": {
                    "type": "profile",
                    "attributes": {
                        "external_id": "14455",
                        "email": "chrisb+one@bigcartel.com",
                        "properties": {}
                    },
                    "id": "01HGXXREVZ9NAJ8TPKMSE39HH1"
                }
            },
            "JSON_ARRAY": {},
            "XML": {},
            "FORM": {}
        },
        "files": {}
    }
]
m
Hey There! đź‘‹ Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
t
Can i get help with this?
m
Looking into this
t
@shy-kite-21035 the easiest interim fix would likely be to check if
payload
is empty and skip that call. There's no reason to make a PATCH call in that case because no props would ever be updated. But the longer term fix is likely to not split the calls at all, but Rudderstack should talk to Klaviyo about what it recommends
m
I will ask the team to talk to Klaviyo. They suggested the first approach in the call yesterday, so in the short term we will go with that.
t
Any ETA on this? Every identify call in production right now is triggers errors for us in Klaviyo, hence why i filed the P0
m
Hi Trevin, the team mentioned that this issue has been fixed.
t
@shy-kite-21035 this is still not fixed. In productoin we are still seeing Klaviyo get hit with these request bodies which are then triggering a 409 error. endpoint:
/api/profiles
example body:
Copy code
{
  "data": {
    "type": "profile",
    "attributes": {
      "external_id": "4781",
      "email": "david+suppressed@bigcartel.com"
    }
  }
}
In the live events log on rudderstack site, here was the full payload: It's the second call (the PATCH) which is still the error and shouldn't be done.
Copy code
[
    {
        "version": "1",
        "type": "REST",
        "method": "POST",
        "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs",
        "headers": {
            "Authorization": "Klaviyo-API-Key xxxxxhiddenxxxxx",
            "Content-Type": "application/json",
            "Accept": "application/json",
            "revision": "2023-02-22"
        },
        "params": {},
        "body": {
            "JSON": {
                "data": {
                    "type": "profile-subscription-bulk-create-job",
                    "attributes": {
                        "list_id": "SN6fp6",
                        "subscriptions": [
                            {
                                "email": "david+suppressed@bigcartel.com",
                                "channels": {
                                    "email": [
                                        "MARKETING"
                                    ]
                                }
                            }
                        ]
                    }
                }
            },
            "JSON_ARRAY": {},
            "XML": {},
            "FORM": {}
        },
        "files": {}
    },
    {
        "version": "1",
        "type": "REST",
        "method": "PATCH",
        "endpoint": "https://a.klaviyo.com/api/profiles/01H946WQ5NEGBT47NQZ92JF07B",
        "headers": {
            "Authorization": "Klaviyo-API-Key pk_xxxxxxxhiddenxxxxxx",
            "Content-Type": "application/json",
            "Accept": "application/json",
            "revision": "2023-02-22"
        },
        "params": {},
        "body": {
            "JSON": {
                "data": {
                    "type": "profile",
                    "attributes": {
                        "external_id": "4781",
                        "email": "david+suppressed@bigcartel.com"
                    },
                    "id": "01H946WQ5NEGBT47NQZ92JF07B"
                }
            },
            "JSON_ARRAY": {},
            "XML": {},
            "FORM": {}
        },
        "files": {}
    }
]
m
Hi Trevin, I have raised this to the team.
Hi Trevin, the team informed me that the purpose of identify call is to create/update the profile. Hence in this case the Patch event must be sent. Also from the admin dashboard we see only 3 errors in the last 1 month. In your case it may be beneficial to instrument a group call for creating the subscription event.
t
But in this case there’s nothing to update here. The attributes are empty. What do you mean to “instrument a group call for creating the subscription event”?
We haven’t deployed this to prod yet, we are extensively testing. Once I flip the switch today the number of errors will skyrocket
m
So the team mentioned that the group event is generally used for creating a subscription and hence we suggested using a Group event.
t
I'm confused... the definition of the
group
event in your docs doesn't say anything about the subscription event: > The
group
call lets you link an identified user with a group like a company, organization, or an account. You can also record any custom traits associated with that group like the company name, number of employees, etc. Why would this work to send a
properties.subscribe: true
trait to klaviyo and not cause an error? This would then force us to great the notion of a
group Id
which isn't present today Right now, the bug seems to be that we are using a transform to convert an
identify
call to a
track
call to them, but Rudderstack still insists on sending a PATCH call to them.
b
@thankful-gpu-70135 we will clarify more on docs but the best way to add user to subscription list is group call only. In group call,
gropId
as equivalent to
properties.listId
. so you need to send your
listId
value as
groupId
Do let us know if you want to instrument group call and need any help from us
t
@bulky-breakfast-19942 This is super confusing because the Klaviyo destination in your docs, supports this trait:
Copy code
properties: {
  subscribe: true
}
And the destination configuration has a LIstID (see screenshot). So if you're saying that the group call is the right way to do this, then the entire experience is wrong here for Klaviyo and likely others. Also, the
group
call documentation doesn't even mention anything about email subscriptions in any way. The entire purpose of that call is to group users together into a group ID. Also, the listID is destination specific (just for Klaviyo) so it's confusing to use a generic group call for one destination. In other words, a listId in klaviyo of "123ABC" does not apply to any other destination. It's super odd to me to have us send a generic group call like:
Copy code
rudderanalytics.group("123-ABC");
when this only ever will apply to Klaviyo. Is this what you mean for us to do and stop sending
properties.subscribe: true
as part of our traits?
m
cc @Mihir
b
group call purpose differs for every destinations. in your case you only want to send subscribe user to list call, which is possible through identify and group call. and you don't want to send extra identify call so we only have one choice to send it via group call. to remove confusion what you can do is you can have separate source for this destination only to send group call and you can bundle rest of the destinations with other source. from our side we will take below improvements : • we will add all mappings in group call documentation and update what klaviyo group call does • as you said in identify call you need to send properties which isn't the expected behaviour. so we will improve that mapping so that you don't have to send it inside properties via transformation @thankful-gpu-70135 do let us know what else improvements you would like us to do?
t
How do you map one group call to one destination?
b
you don't have to map. just send group call. and keep 1 destination (klaviyo) connected with 1 source, so that other destinations group calls won't get affected
t
This is a pain and erodes the value of Rudderstack if this is how it’s meant to be done. If we’ve got Klaviyo and say Facebook conversions API as destinations I then need our backend to send events to 2 sources right for the same event? Or am I misunderstanding?
b
no, you only need different source when you have 2 different destinations and you want to send calls to both of them and data is different for both destination calls in your case i am suggesting because your use case is different otherwise you don't need multiple sources for case of Klaviyo and Facebook conversions API as destinations you don't need 2 sources because you will send group calls to klaviyo where as Facebook conversions API doesn't support group calls so you are safe there
we can hope on call if you want after weekend
t
I really don’t like this approach. While FB conversions doesn’t support group calls if I ever add another destination in future that does, I then have to create a source then and then deal with doubling event counts. IMO this is not a great design to need a group call for this