hey everyone! I’m working on passing webhook event...
# support
m
hey everyone! I’m working on passing webhook events to Active Campaign with the end goal of utilizing these events to create and update contacts in AC. I’ve got the connection set up and see the events reaching AC, but the properties are being stripped out. I’ve looked through git and couldn’t see exactly what is happening (js isn’t my forte sooo probably missed it haha), does anyone have some documentation or examples on how a transformation can be used to correct this?
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 Nolan, generally the parameters within the properties object are sent as is. So if you want some parameters to be sent you should put it in the properties. Also can you share the properties that are not being sent along with samples from the source and destination.
m
hi Ranganath! Here’s an example of the source, it’s a webhook event where we have a script grabbing emails to send to Rudderstack
Copy code
{
  "anonymousId": "****",
  "event": "webhook_source_event",
  "messageId": "54dac44b-4c51-459e-add4-915dea843106",
  "properties": {
    "email_body": [
      "        Client Phone Call                            \r\n                                       Hi,\r\n\r\n The phone call you received at 13:27 EST was from a person who found you\r\non ....."
    ],
    "email_cc": [
      ""
    ],
    "email_date": [
      "Tue Dec 12 12:30:17 GMT-06:00 2023"
    ],
    "email_from": [
      "no-reply@email.com"
    ],
    "email_subject": [
      "Client Phone Call"
    ],
    "email_to": [
      "email@email.com"
    ]
  },
  "rudderId": "****",
  "type": "track"
}
and here is what I’m seeing on the destination side
Copy code
{
  "version": "1",
  "type": "REST",
  "method": "POST",
  "endpoint": "https://trackcmp.net/event",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Api-Token": "***"
  },
  "params": {},
  "body": {
    "JSON": {},
    "JSON_ARRAY": {},
    "XML": {},
    "FORM": {
      "event": "webhook_source_event",
      "actid": "****",
      "key": "****",
      "visit": "{\"email\":\"undefined\"}"
    }
  },
  "files": {}
}
my guess is the properties are not in the correct objects to be parsed properly before sending to Active Campaign, I’ve played around with a transformation but haven’t been able to get it to work
m
Hi Nolan, yes that is correct. You can try sending a standard rudderstack track event. It should look like this
s
Copy code
{
  "properties": {
    "category": "Food",
    "label": "Add",
    "product_id": 3,
    "value": 1
  },
  "event": "Food_added_to_cart",
  "type": "track",
  "channel": "web",
  "context": {
    "traits": {
      "name": "6223p8j7pm6r4st",
      "category": "Identify User",
      "email": "6223p8j7pm6r4st@gmail.com",
      "age": 36,
      "logins": 78
    },
    "sessionId": 1702394262012,
    "app": {
      "name": "RudderLabs JavaScript SDK",
      "namespace": "com.rudderlabs.javascript",
      "version": "3.0.0-beta.17"
    },
    "library": {
      "name": "RudderLabs JavaScript SDK",
      "version": "3.0.0-beta.17"
    },
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "os": {
      "name": "",
      "version": ""
    },
    "locale": "en-GB",
    "screen": {
      "width": 1512,
      "height": 982,
      "density": 2,
      "innerWidth": 703,
      "innerHeight": 860
    },
    "campaign": {},
    "page": {
      "path": "/",
      "referrer": "$direct",
      "referring_domain": "",
      "search": "",
      "title": "Counter App",
      "url": "http://localhost:3000/",
      "tab_url": "http://localhost:3000/",
      "initial_referrer": "$direct",
      "initial_referring_domain": ""
    },
    "timezone": "GMT+0530"
  },
  "originalTimestamp": "2023-12-12T15:18:15.007Z",
  "integrations": {
    "All": true
  },
  "messageId": "2da6c552-6445-4f13-acae-6437af933ea7",
  "userId": "6223p8j7pm6r4st",
  "anonymousId": "bc2f824a-4ef2-48ae-9970-1d51cc8a9d4d",
  "sentAt": "2023-12-12T15:18:15.008Z"
}
m
Ah ok! These events are coming in to Rudderstack via a webhook so they’re formatted differently. Do you think creating a transformation to match the above format would solve the issue?
s
Note the context > traits and the properties are important
Yes that would definitely work.
Let me know of you need help with the User transformation.
m
ok cool. Of the above, do you know which ones are required? Thinking some of them such as the page details and several of the IDs won’t be available
m
Mandatory • Top level parameters • properties object • Context > traits
m
thanks! I’ll work on a transformation and reach out if I need any assistance
hey @shy-kite-21035 I worked on a transformation to build the event as outlined above but still not seeing the properties come through. Do you know if this is by design?
Example output being past to Active Campaign
Copy code
{
  "version": "1",
  "type": "REST",
  "method": "POST",
  "endpoint": "https://trackcmp.net/event",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Api-Token": "369ed5d639549550af8981f2183f8a5d7c828f34d98b419d50dff901154c5cc3bbcf63c2"
  },
  "params": {},
  "body": {
    "JSON": {},
    "JSON_ARRAY": {},
    "XML": {},
    "FORM": {
      "event": "eMail Message",
      "actid": "476775567",
      "key": "d0eb2351ef7451a03de9292ae50e56b2b26f47d5",
      "visit": "{\"email\":\"jane@test.com\"}"
    }
  },
  "files": {}
}
here’s the input coming out of the transformation. I added the properties to context when troubleshooting and didn’t seem to change anything
Copy code
[
    {
        "eventName": "Psychology Today Message",
        "eventType": "track",
        "payload": {
            "anonymousId": "66eeb3a6-ec85-4599-9cc8-91a30008ca32",
            "context": {
                "traits": {
                    "category": "eMail Message",
                    "client_email": "jane@test.com",
                    "client_name": "Jane Doe",
                    "client_number": "123-456-7891",
                    "email": "jane@test.com"
                }
            },
            "event": "eMail Message",
            "messageId": "eaee4ce7-816d-404f-a1d6-1c5eacc377c0",
            "originalTimestamp": "2023-12-18T21:04:58.122Z",
            "properties": {
                "client_email": "jane@test.com",
                "client_name": "Jane Doe",
                "client_number": "123-456-7891",
                "subject": [
                    "Therapy"
                ]
            },
            "receivedAt": "2023-12-18T21:04:54.518Z",
            "request_ip": "64.226.129.208",
            "rudderId": "df89bc07-e959-4467-9d04-5878e1a78bce",
            "sentAt": "2023-12-18T21:04:58.122Z",
            "timestamp": "2023-12-18T21:04:54.517Z",
            "type": "track"
        }
    }
]
s
Copy code
{
  "event": "Psychology Today Message",
  "type": "track",
  "anonymousId": "66eeb3a6-ec85-4599-9cc8-91a30008ca32",
  "context": {
    "traits": {
      "category": "eMail Message",
      "client_email": "jane@test.com",
      "client_name": "Jane Doe",
      "client_number": "123-456-7891",
      "email": "jane@test.com"
    }
  },
  "messageId": "eaee4ce7-816d-404f-a1d6-1c5eacc377c0",
  "originalTimestamp": "2023-12-18T21:04:58.122Z",
  "properties": {
    "client_email": "jane@test.com",
    "client_name": "Jane Doe",
    "client_number": "123-456-7891",
    "subject": [
      "Therapy"
    ]
  },
  "receivedAt": "2023-12-18T21:04:54.518Z",
  "request_ip": "64.226.129.208",
  "rudderId": "df89bc07-e959-4467-9d04-5878e1a78bce",
  "sentAt": "2023-12-18T21:04:58.122Z",
  "timestamp": "2023-12-18T21:04:54.517Z"
}
Your event should look like this.
m
I can try to update the transformation, but the format I shared earlier is how RS is parsing it to send to Active Campaign. I’ll test updating the transformation again and see if the resolves the issue
m
Don't worry how RudderStack is parsing it. You must send it in this format. This (standard) format is then converted to that parsed format based on the destination
m
gotcha, thank you! I’ll let you know if I run into any additional issues