Hey guys, If I have two Mailchimp destinations (di...
# support
a
Hey guys, If I have two Mailchimp destinations (different
listIds
), and I want to send identify events to one or the other or both depending on business logic, how can I do that? I understand we could do something like:
Copy code
integrations: {
  "All": true,
  "MailChimp": false
}
But if I have two Mailchimp destinations this seems to apply to all of them at the same time, right? How can I tell Rudderstack to only target one specific destination from Maillchimp? Is there a way to use the destination id inside the identify call somehow? Also, where do I get the names of all the keys for the destinations that can be used inside the
integrations
object? some seem to have camel case
s
Hey There! 👋 Your message has been received by the RudderStack team. 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.
r
Hi Felipe, I hope you're well. I don't believe it's possible to specify the exact destination instance(exact MailChimp instance) via the
Integrations
object. You can only select the destination name and after this, the filter applies to all instances of the chosen destination. It's not possible to add the destination id in there(as far as I'm aware). So doing what you intend on doing with the Integrations object is likely not the best approach. What you can do instead is use a Transformation. Here's an example of the particular transformation that you'd be interested in. I've modified it slightly to basically block all Identify events:
Copy code
export function transformEvent(event, metadata) {
    const eventTypes = ["identify"];
    const eventType = event.type;
    if (eventType && eventTypes.includes(eventType)) return;
    return event;
}
^ this transformation should block all identify events on whatever destination you apply this transformation to(you can choose the exact MailChimp instance to which this transformation will be applied to). It's basic business logic but you can pretty much get as advanced with it as you like.
q
Hi @able-controller-17526 you can check transformation https://www.rudderstack.com/docs/features/transformations/
thank you @red-engineer-90710
a
Thanks for the answers guys @quiet-wolf-72320, @red-engineer-90710 I think I understand what you are suggesting, but transformations are confusing for me due to not having a connection with the application logic For example, we have a form where users fill their email and two checkboxes one to whether to accept or reject receiving marketing emails, and another to be part of the best testing Mailchimp list. As you can see these two checkboxes tell us to which Mailchimp lists to send the identify calls. How can I achieve this with transformers? Or in other words, how can I share application state with the transformers?
I've created a feature request about this in the JS SDK. If this is not the correct repo I can move it accordingly. https://github.com/rudderlabs/rudder-sdk-js/issues/819
r
Without knowing too much about the ins and outs of your particular implementation, what I would expect happens in the frontend with those checkboxes is that you likely set some trait on your identify events based on whether or not the checkbox is toggled or not. This trait would come into RudderStack via the identify event. When the identify event comes into RudderStack, you could read this trait in the transformation and based on it's value either send the identify event to Mailchimp or not. Does that clear it up a little further? I'll try and create a spaghetti logic flow, that might clear it up more
a
Thanks @red-engineer-90710 I'll use the transformation
👍 1