But it’s not clear to me how to pull this information out in Automations so that I can either update and existing contact or create a new one if one doesn’t exist yet.
Forgive me a bit since I am not completely familiar with FastSpring. I assume that you are sending that POST request as an action when somebody makes a purchase. What endpoint are you sending that to? Are you sending it to ActiveCampaign?
Eventually we will open up our Deep Data API and encourage somebody to make a native FastSpring integration. In the meantime you could take advantage of our ActiveCampaign Event Tracking to accept a request like that.
Another option is to integrate with a 3rd party tool like Zapier. You can “catch” the post request, format it, and send it along to ActiveCampaign in a number of different ways.
Yes, I’m sending in a POST request (with JSON body as shown above) to the https://trackcmp.net/event endpoint.
What’s not obvious to me is
how a contact is created if it doesn’t already exist (perhaps this just happens automatically if the visit.email property exists and no contact with that email exists), and
how my other custom data can get mapped to custom fields in my new contact, e.g. things like firstName or isTest.
When you make a call to the request endpoint, you are not creating or modifying a contact record you are only modifying (creating) the event. When you pass an email in the event you are then able to associate an event with a contact record. (events belong to contacts).
You can then search and segment your contacts based on whether the event happened.
If you track an event, and attach an email address for a contact record that doesn’t exist yet, then the event “waits” until that contact has been identified using one of several other API calls or methods for creating the contact.
In order to create a new contact record, you actually need the contact_sync API call: API Examples Using contact_sync (you can use contact_add also).
You would update the fields on a contact record the same way, with a contact_sync api call. You can then pass along the custom fields using the personalization tags associated with the contact record.
Another way to think about this, is that the contact_sync endpoint is an “identify” call, and then the event is the “track” call: {{ identified_user }} did {{ event }}
Ok, thanks. That makes sense. If I can follow down this path one more step: if I want to start up an automation when the user buys a product, do I need to call contact_sync and then make a separate call for the event to start some automation (e.g. email a “how’s it going?” 3 days from now), or is there a way of just starting up an automation if a contact is created or updated in a certain way, e.g. gets a tag for a certain product?
You could actually do it several ways, you could start the automation when the event is fired. You could start the automation when the contact is added to a list, or you could start the automation when a tag is added (or removed). Finally, you could start the automation when a field is updated.
I personally like to stick with events, and use tags to segment who to include/exclude, but everybody is different!