A WebTrigger (also called a webhook) lets AE tell your own system when something happens, so you do not have to keep asking. When the event occurs, AE sends one server-to-server HTTP POST request to the address you choose. Typical uses are syncing activity into a CRM, feeding a data warehouse or analytics tool, updating loyalty or marketing automation, and keeping deletions in step across the systems you run.
Event types
Type | Fires when |
Activity Recorded | A member completes an activity that AE records. |
Member Delete | A member profile is deleted. This happens in every case, whether the member deleted the profile or it was deleted through the API. |
Consent Changed | A member's consent for a brand or segment really changes (see below). |
Create a web hook in the AE dashboard
- Open AE Connect and click the application you want to configure.
- Click the Web Hooks tab. The tab lists your existing web hooks with their ID, Name, Destination, Type and State.
- Choose the type you want (Member Delete, Activity Recorded or Consent Changed) and click to add a web hook. The Add Web Hook window opens with a Basic tab and an Advanced tab.
- On the Basic tab, enter a Name so you can recognise the web hook later.
- Enter the Destination URL. This is the address of your own endpoint. Use an HTTPS address.
- Turn on Active when you want the web hook to start sending.
- Optional: open the Advanced tab to add destination parameters and HTTP headers.
- Save the web hook. It now appears in the list with its type and state.
Web hooks are available in the dashboard where your licence supports them.
To change which fields are sent, or to ask for fields that are not listed below, contact the AE support team.
What your endpoint must do
- Accept POST requests with the content type application/x-www-form-urlencoded. The payload is form-encoded, not JSON.
- Return an HTTP 2xx response to confirm receipt.
- Process or queue events quickly, then respond.
- Handle the same event arriving more than once. Store the event ID of each event you have processed, ignore repeats and still return 2xx.
- Use HTTPS.
Tip
Add a shared secret to the field mapping, for example token=YOUR_SHARED_SECRET, and check it before you process a request. Keep the secret out of logs and public code.
What a request looks like
Each web hook sends a set of key and value pairs built from a field mapping. Placeholders in angle brackets are replaced with real values when the event fires. A mapping for Activity Recorded can look like this:
event=activity_recorded&event_id=<id>&member_id=<memberid>&email=<memberemail>&activity_id=<activityid>&completed_at=<completedate>
Activity Recorded fields
Placeholder | Meaning |
<id> | Unique ID of the activity record |
<activityid> | Activity definition ID |
<activitytype> | Activity category or type |
<brandid>, <brandname> | Brand ID and name |
<service> | Normalised service name, for example spotify or youtube |
<shortname>, <name>, <fullname> | Activity names |
<memberid>, <membername>, <memberemail>, <memberavatar> | Member ID, username, email address and avatar address |
<partnerid> | Partner ID, if applicable |
<remoteusername>, <remoteuserid>, <remoteuserurl> | The member's username, ID and profile address on the other platform |
<completedate>, <timezone> | When the activity was completed, and the time zone |
<link>, <content>, <value>, <segment> | Source link, activity content encoded as JSON, numeric value, and segment context if there is one |
Member Delete fields
Common fields are <origin>, <uid>, <username>, <firstname>, <surname>, <email>, <joined>, <lastvisited>, <deleteddate> and <application>. Some may be empty, so let your endpoint accept missing values.
Consent Changed fields
Field | Value |
|
|
| A stable identifier for the event |
| The application ID |
| The member ID |
|
|
|
|
|
|
|
|
| The time of the change, in RFC 3339 format |
Additional consent information | Further details about the consent, where available |
This event is sent only after a real change of consent state:
- a member opts in to a segment (not answered to granted)
- a member opts out of a segment (granted to revoked)
- a member opts in to email for a brand (not answered or revoked to granted)
- a member opts out of email for a brand (granted to revoked)
- the wording of a brand opt-in changes after consent was already granted (sent as
updated)
Consent Changed relates to formal brand and segment consent changes that are saved, not to every cookie consent change a visitor makes in the browser. Its availability depends on your release, so check with the AE support team before you rely on it.
A failed delivery does not undo the consent change. Map your own purpose names to the brand: and segment: identifiers on your side.
If your endpoint cannot be reached
When retries are enabled, a failed delivery can be queued and tried again. By default, AE works through a retry batch of 50 queued records each time retries run, and it retries records for up to 48 hours. The batch size is the number of queued records handled in one run. It is not a limit on how many times a single event is retried, and no fixed maximum number of attempts per event is set.
A web hook waits up to 3 seconds to connect to your endpoint and up to 15 seconds for a response, so respond quickly. Events are not guaranteed to arrive in the order they happened, so use the time fields in each payload when order matters.
For details such as the delay between attempts or the addresses requests come from, contact the AE support team.
Test your endpoint
- Start with a staging endpoint.
- Log the full request body while you validate.
- Confirm that your endpoint returns a 2xx response.
- Confirm that a repeated event is ignored safely.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article