Triggering an automation via custom event

Hi there,

I am trying to trigger a simple deal update via a custom event that we want to fire from our app’s server. I am getting {“success”:1,“message”:“Event spawned”} as a response but nothing seems to happen on the dashboard.

This is the python script I am using to test this at the moment :

params = [
(‘actid’, ‘MY_ACT_ID’),
(‘key’, ‘MY_EVENT_KEY’),
(‘event’, ‘__survey_done’),
(‘eventdata’, ‘’),
(‘visit’, json.dumps([(‘email’, user_email)])) ← I am not too sure about this part at all …
]
r = requests.post(url=‘https://trackcmp.net/event’, params=params, headers={‘Content-Type’: ‘application/x-www-form-urlencoded’})

Any help would be greatly appreciated!

1 Like

Hey @sarwa717081,

I always recommend users test things out with a tool like POSTman or vanilla curl before digging into language specific debugging.

One thing I notice though, is I don’t see the email anywhere, so you might be successfully sending events into AC, but they are not attaching to any user.

Hi @jskole,

You are absolutely right, I don’t think active campaign is receiving the contact, but I am not sure exactly how I am supposed to provide it.

In the code snippet I sent, the email is dynamically fed into the visit parameter under ‘email’. This is one of many different combinations I tried to send the contact email with no luck.

FYI, postman gives me the same response as my terminal : {“success”:1,“message”:“Event spawned”}

Can you send me a screenshot of your POSTman config?

Solved it.

My issue was that I thought I could just send the contact email via my event’s parameters and then the automation would get the contact email from the event.

I made a post request to add the contact to the automation contact list (via automation_contact_add action) and then it worked.

1 Like

sweet! Glad you were able to get to the bottom of it!