Hi all. I’m looking for some clarification on a Pi...
# support
r
Hi all. I’m looking for some clarification on a Pinterest v5 integration. 1. Enhanced Match: Per the documentation, can I expect that the email is getting automatically hashed and sent with every call after I make an identify call (after authentication). Do I need to do anything more (other than enabling enhanced match in my Rudderstack Pinterest config? 2. Identify: Pinterest doesn’t like the “identify” event. I get the following error in the Rudderstack event error log when I call “identify”. Should I exclude Pinterest from the identify call? Would that affect enhanced match?
Copy code
"{\"response\":\"message type identify is not supported\",\"firstAttemptedAt\":\"2023-10-19T14:32:37.116Z\",\"content-type\":\"application/json\"}"
m
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.
Hi Steve, 1. Yes the email should be sent as a SHA 256 hash to the destination as per these docs . You can check in the destination live-events that the email column is sent as a SHA 256 hash. Let me know if this is not working properly. 2. Identify call does not seem to be supported in cloud mode but is supported in device mode for Pinterest. Doc on connection mode 3. Some event failures observed since the productId field was expected to be a string but is a float (number). You can solve both 2 & 3 by using a user-transformation. Below is sample code for 2.
Copy code
export function transformEvent(event, metadata) {
    if (event.type === "identify") {
       return;
    }
    return event;
}
Ideally identify events should not be sent to destination but since the destination is in Beta it still has a few issues. Also sample user_transformations . Let me know if you need help with 3.
r
Thanks @shy-kite-21035! For clarification for #1, it looks like I should include the hashed email in track and conversion calls? There seem to be multiple places to put the email. Does it belong in the traits?
Copy code
rudderanalytics.track("Order Completed", {
  event_id: 'eventIDordercompleted',
  order_id: "transactionId",
  email: 'SHA-256 ENCODED EMAIL' // HERE
}, {
  traits: {
    email: 'SHA-256 ENCODED EMAIL', // OR HERE?
    lastname: "Keener",
    firstname: "Alex",
    action_source: "offline"
  }
});
Also is it necessary to have the email on all the ‘page’ calls for it to be effective for enhanced conversion?
m
Hi Steve,
Yes the email should be sent as a SHA 256 hash to the destination as perthese docs. You can check in the destination live-events that the email column is sent as a SHA 256 hash. Let me know if this is not working properly.
What I meant by the above is that the email should be sent to the destination as SHA 256 hash. However, that does not mean that you need to send it as a SHA 256 hash. It is the job of the Rudder transformer to convert your plain text email to a SHA 256 hash. Hence if the plain text email that you send from your source is not sent as a SHA 256 hash to the destination, you should inform me so that I can raise a bug to the team that transformer is not convert the email to a SHA 256 hash.
About Identify call:- Once you make an identify call, any subsequent track/page events will have the traits attached in the `context > traits`⁣. Ideally you should make an identify call whenever your user does a sign up (or) log in or when he updates his profile. These properties are then sent in the `context > traits`⁣ for subsequent track/page events.
r
Thanks @shy-kite-21035. We ended up encoding it in the transformer like so.
Copy code
import { sha256 } from '@rs/hash/v1';

export async function transformEvent(event) {
    const email = event.context?.traits?.email;

    // Prevent 'identify' from being sent in cloud mode
    if (event.type === "identify") {
       return;
    }
    if (email) {
        event.context.email = sha256(email);
        event.context.em = sha256(email);
    }
    return event;
}
I wasn’t sure if i needed to map to the
em
field or if you do that.
m
I would have to test that out. Can you share a sample payload you are sending.
The destination transformation should hash the email id (I am not sure about the em field so I wanted to test with your sample payload). So Ideally you do not need to hash the data in the user transformation Note:- User transformation is written by you to add/remove fields or to filter data. Destination transformation is RudderStack engg team so that the data is in the right format as per the destination.
RudderStack should drop identify events and not send them to the destination that throw errors (Since they are not supported). The team has mentioned that they will make this fix in the next release. TLDR:- - RudderStack should drop the identify events (will be done in next release) - RudderStack should hash the email id before sending to the destination - Based on above you need not write a user transformation for the above (you may need one only for the 'em' parameter) - Request a sample event from you to test out whether 'em' parameter is being hashed.