We use the iterable integration quite heavily. Whe...
# support
c
We use the iterable integration quite heavily. When I make a
track
with a trait called `email.`The data gets sent successfully but IF its a NEW user inside iterable - the system does not create a new user - it becomes some sort of ghost profile. Coming from mParticle - we were able to send custom events - and as long as it had an
email
included - a user will be updated or created. Curious if someone could take a look at this integration and see if its possible to alter this functionality. Would be nice to not always have to use
identifty
. Sometimes we just want a quick custom event with the
email
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.
c
The other issue here is - if we don’t know the users user_id and we leave the identifity user-id field blank but include email…. the anonymous_id overwrites the real user Id in iterable
This has the potential to really ruin things downstream. Since its technically not the user_id….
<script>
var cartEmail = '{{cart_email}}';
rudderanalytics.track("added_to_cart", {
'namespace': '{{namespace}}'
}, {
traits: {
email: cartEmail
}
});
</script>
Above is the code - how can I add a user to iterable without a user_id and not have the anonymous_id overwrite the user_id inside iterable if they do exist?
m
Hi Rick let me check on this and get back to you.
Hi Rick couple of things - Can you share the sample payload you are sending for the track call with email traits? Does this event have a userId? - For the second can't you use a user transformation and send the user email in the userId column. Won't this map the event to the correct user?
s
Hi Richard, I tested this out and I found that when the userId is not present, RudderStack is sending the anonymousId as the userId, even if the email is present in the traits. The team is looking to change this so that if email is present in the traits, it can be used as the userId for Iterable. In the meantime, since you are sending the email in the traits, you can use the following user transformation to set the email as the userId.
Copy code
export function transformEvent(event, metadata) {
    const {type, userId} = event;
// Return the original event if type is not track
    if (type !== "track") return event;
// Fetch email from context or properties
    const email = event.context?.traits?.email || event.properties?.email;
    if (type === "track" && !userId && email) {
// Update the userId with email if present
        event.userId = email;
    }
    return event;
}
Note:- Kindly test the above user transformation thoroughly before deploying it in Production.