I am using android Rudderstack SDK to send events ...
# support
a
I am using android Rudderstack SDK to send events to rudderstack. From there I am consuming the events via webhook. Is there any way by which I can send some information in headers via rudderstack client. And receive that information in headers of my webhook? Thanks in advance.
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.
a
What is best way to some of sensitive information via rudderstack client?
When was shopify added as source in rudderstack, I did not see it few months back. I am seeing it now.
m
Hi Nilesh, so just to be clear you want to make a rudderstack track or page call in the Android SDK, but want to be able to pass some parameters as headers. Is that correct?
Hi Nilesh, so you want to send to encrypt the data before sending it to the RudderServer. I don't think that is available now. We however has encrption support at the user -transformation.
The Shopify event-stream source was released in Feb 2022 and the Shopify extract source was released in Mar 2023.
a
Hi Ranganath, Can I pass headers through SDK client?
m
That feature is not currently supported but let me confirm with the team and get back to you.
a
Ok
m
You can use the following in the user transformation to append the storeId to the events coming from each source.
Copy code
export function transformEvent(event, metadata) {
  let updatedEvent = event;
  const met = metadata(event);
  if (
    met &&
    met.sourceId === "shopify_source_id_1" &&
    event &&
    event.properties
  ) {
    updatedEvent.properties.storeId = "storeId_1";
  } else if (
    met &&
    met.sourceId === "shopify_source_id_2" &&
    event &&
    event.properties
  ) {
    updatedEvent.properties.storeId = "storeId_2";
  }
  return updatedEvent;
}
Notes:- 1. Kindly test out the transformation thoroughly before deploying in production. 2. The metadata(event) method is not available to the sample events(since the sample events are just dummy events), but should be available to live events. Docs here
a
Let me check it out.
m
I have added the storeId to the properties object, but you can append it to other objects as well, like context > traits
a
Ok Let me check
Also why the events generated from shopify do not contain any shopify-store information. As multiple shopify stores can use the same rudderstack source in that case.
m
Are you using the Shopify extract source or the Shopify event streaming source? Can you provide the sourceIds?
a
Please find the details. I am using Event Stream Source. What is difference between Event Streams & Cloud Extract?
I don't think sharing sourceIds on this public channel would be good idea.
m
Event stream sends data as and when it happens, the Cloud extract is more like a store that sends data on a fixed schedule.
The SourceId is public data as anyone can see it in the network tab.
a
Ok You are asking for sourceId to modify the above given code, right?
m
No I can’t modify code with sourceId.
a
I find your code helpful. That would solve my problem.
Thanks.
m
Oh ok nice. So was that the only issue you had?
a
Yes But I have few more questions🙂 Many shopify events have headers which contains information like storeId, topic-name etc. Why does rudderstack does not include it in rudderstack events? In that case we don't have to create separate rudderstack source for each shopify store.
m
This I am not sure about. Let me check with the team how it was implemented and why?
a
Yes Please So I will take followup on 2 questions: • Adding headers through android SDK rudderstack client • why shopify headers [like,
X-Shopify-Shop-Domain
] not included in rudderstack events. Thanks.
m
So I was chatting with the team and they asked me what your use-case is to send additional parameters using the headers in Android SDK?
a
I have some sensitive data which I don't want to expose in properties.
m
But then I don’t think putting that information in the headers is the correct option for that case. Won’t it be better to encrypt the data at the source and then decrypt it later (or hash the data)
a
Let me think over it.
You are right.
I did not get this flag? From rudderstack docs it seems when this flag is enabled I won't get user information in traits, but I am getting it. Or am I misunderstanding something here?
m
I think that this just means that the client side identify events are not send to the rudder-server. The Shopify source works differently from other sources and any traits are automatically added to the track/page calls.