How to set up a javascript event to trigger an automation

I have been looking all over to find an example and instructions for putting a javascript-only event on a button in a webpage to trigger an automation. Anyone have anything to share?

Seems like you could use one of AC’s API functions to trigger the automation, like this one:

http://www.activecampaign.com/api/example.php?call=automation_contact_add

Scroll all the way down the page for a PHP example. You could convert the logic into JS to call the same API function.

The list of other automation-triggering functions is on the left here:
http://www.activecampaign.com/api/overview.php

Hey there,

Biannca here from our CX team - I just wanted to update this post and share that our API has been updated to v3.

You can find the most updated API call here:
https://developers.activecampaign.com/reference/create-new-contactautomation.

You can also find other automation triggers via this section of the API under Contacts > Automations.

Please don’t hesitate to reply back out or email us at help@activecampaign.com if you have any further questions.