Hello everyone, I'm in the process of integrating ...
# support
p
Hello everyone, I'm in the process of integrating the Koala's server-side destination with Rudderstack. To give everyone a bit of context, our system automatically hooks into Rudderstack on the client-side. This means that if a customer has our implementation set up on both the client-side and server-side for the same events, we'll end up collecting duplicate data, which is undesirable. I'm seeking a solution to distinguish events originating from the Rudderstack client within a browser from those sent directly from another server to Rudderstack. This distinction would allow us to selectively ignore browser-based events, thereby preventing data duplication. One potential approach could be to examine if the User-Agent differs for these scenarios. Does anyone have insights on whether this is a viable method or suggest any alternative strategies? Thank you for your assistance.
m
Hi Gustavo, Hi Gustavo, if you know which events to drop then you can easily do so using a user-transformation. However, how would you know if a customer has setup your implementation on both the client and server-side. Do you have an API end-point which given a customerId provides whether they have a server-side setup or not?
p
I think that's the main question, I think currently we dont have a way to checker wether customer have browser, server-side or both integrations set. I wonder if we add a custom header for that could solve this?
g
This is an interesting question. It will be useful to get community and the integration team's perspective on how RudderStack can enable easier deduplication of events collected from two related sources which represent only one unique event conceptually.
I'm not aware of any feature that can enable such deduplication as of now @shy-kite-21035 Assuming the same, what I can think of is either putting a conditional on user-agent, event time, and other event properties. Or we could pick the properties that make an event unique and create hash using those and then compare the hash for duplicates.
p
Yeah, that looks pretty good
m
@quick-answer-75801 I mean we can do deduplication but these events contain different data . For example what unique identifier would you use to remove these events. Also our current definition of deduplication is for removing multiple events from the same source (having the same messageId).
Or we could pick the properties that make an event unique and create hash using those and then compare the hash for duplicates.
This could have multiple edge cases to consider.
p
Right, what about just flagging requests from different origins so we ca check on deduplications on our side?
if we are able to differentiate requests from broser to server-side, I think we can also help on the deduplication
s
We have a key called `channel`⁣ that can help distinguish between the server and client side events. For example - For backend events, the channel key `event.channel`⁣ is set to `server`⁣ - For web events, the channel key `event.channel`⁣ is set to `web`⁣ - For mobile events, the channel key `event.channel`⁣ is set to `mobile`⁣
🙌 1
p
ow nice, so that would be scoped on the message like
$.message.channel
m
Yes so for each event we have the property called channel which you can access by calling ev.channel or message.channel
p
perfect, going to include that in the transformation
m
Cool :)
p
Hey folks, sorry to pull this thread again, but I think there's something weird going on with the channel property. I was unable to use it on tests, and it didn't matter how I tried to access it; I couldn't retrieve the value during transformation. 1. Set
channel: 'web'
as a new parameter on the root of the message body 2. tried to retrieve it through
$.channel, $.message.channel,  .message.().({{{{$.getGenericPaths("channel")}}}})
all blank 3. Tried to research some other transformation that might be doing it, but couldn't find any. Most tests that include channels do not use it in transformation. Not sure what am I doing wrong here
👀 1
g
Let me get back to you after gathering more info on this topic in the next couple of days
p
Thanks @gentle-petabyte-80785
m
The channel property is already present in the event. I just used a sample event. You can see the log function correctly displaying the value. You can overwrite the channel by setting `event.channel = 'server';`⁣ and returning the event.
p
right in this case that mens
$.event.channel
? not on the
$.message
escope?
m
Sorry I am not sure what $ means in this case, but yes event.channel
p
I usually use the
$
to access access message, context ou create new attributes during the transformation.
Ok, going to try checking on the event.channel, thanks @shy-kite-21035
m
Sure. Since the variable name is already present (called `event`⁣ ) you should use event.channel . FYI note you can do event.prop1?.inner_prop2?.other_prop . Eg: event.context?.app?.build Using the above syntax will prevent any transformation failures if event.context is null .