Integrate ActiveCampaign with Magento 2
What Is Webhook?
Webhook is basically user-defined HTTP callbacks which are triggered by specific events. When a trigger event occurs in the source site, the webhook sees the events, collect the data and sends it to the URL in the form of an HTTP request.
About ActiveCampaign
ActiveCampaign is a professional email marketing software which supports online stores in business management, such as online meetings, customers.
Owners can track events of the store from Magento on ActiveCampaign by integrating Magento and ActiveCampaign with Webhook extension made by Mageplaza.
Webhook Extension for Magento 2
Unlock the power of Magento 2 Webhook today and enhance the flexibility and interactivity of your website!
Check it out!Entities of Magento which Webhook support:
- Customer
- Order
- Invoice
- Shipment
- Credit Memo
- Product
- Category
- Abandoned Cart
Entities of ActiveCampaign:
- Contacts
- Companies
- Deals
How To Integrate ActiveCampaign With Magento 2 With Webhook
Instruction for registering and using ActiveCampaign:
Access to here, Click the Try it free button > Fill your registered email > Click the Create Account button:
Fill your name > Click the Next Step button
Next, Fill your phone number > Click the Next Step button :
Complete your company information > Click the Next Step button:
Then, choose your favor object by clicking to the checkbox:
After that, fill tools which you are using to the box:
Finally, fill in your password > Click the Take Me To Account button to complete the registration:
After registering successfully, you can take the following steps to get the ActiveCampaign API URL and Key:
From the menu which is on the left, select Settings
Next, choose Developer, you will see API URL and Key
These Fields Of ActiveCampaign
To view the latest fields of ActiveCampaign, you can click here
Instructions For Creating Hook
How to create a new contact in ActiveCampaign via Magento 2
Required fields
Optional fields:
- First name
- Last Name
- Phone
In this section, we will instruct you how to configure Webhook integrating with ActiveCampaign:
From the Admin Pane go to System > Webhook > Manage Hooks, on the right corner, select Add New with choices: New Order, New Customer, Update Customer, Delete Customer, New Order, etc.
Step 1: Fill all information in the General Information tab
Step 2: Enter the data on the Action tab
Note:
- Payload URL:
- POST URL: https://:account.api-us1.com/api/3/contacts,
- GET: https://:account.api-us1.com/api/3/contacts/id
with https://:account.api-us1.com is the API URL from your ActiveCampaign
-
Headers: Click the Add button to add values of headers such as Name and Value as the request of the server to call that API. Name =Api-Token, Value is the API from ActiveCampaign.
-
Body: With the POST or PUT method, you need to fill the body
- In case you create a hook with new_customer, when it is integrated with ActiveCampaign will create a new contact, you need the following body part:
{
"contact": {
"email": "[email protected]",
"firstName": "Layla",
"lastName": "Harris",
"phone": "9223224241"
}
}
Note: When you need to get any field, replace that field with the variable from Insert Variable.
The results of creating a hook:
When some events are performed on Store such as adding a new customer, data information will be saved at Hook Logs:
Click Select > View, this will redirect you to the view log page to view data information
The Result Shown At ActiveCampaign
These Available Body Templates
New Deals:
Required fields:
- Title
- Contact
- Value
- Currency
- Group
- Stage
- Owner
Optional fields:
- Description
- Percent
- status
Payload URL:
- POST URL: https://:account.api-us1.com/api/3/deals
- GET, PUT URL: https://:account.api-us1.com/api/3/deals/id with https://:account.api-us1.com is the API URL from your ActiveCampaign
Headers: Click the Add button to add values of headers such as Name và Value as the request of the server to call that API. Name =Api-Token, Value is the API key from ActiveCampaign
Body Template:
{
"deal": {
"contact": "59",
"description": "This deal is an important deal",
"currency": "usd",
"group": "1",
"owner": "1",
"percent": null,
"stage": "1",
"status": 0,
"title": "AC Deal",
"value": 45600
}
}
Note: When you need to get any data field, replace that field with the variable form Insert Variable.
Conclusion
We have instructed how to register ActiveCampaign and create Hook when using Webhook Extension of Mageplaza as well as how to integrate Webhook with ActiveCampaign. You can view more functions for your store here.
Magento API Integration Service by Mageplaza
Connect your store with any 3rd-party software and boost customer experience quickly and efficiently.
Learn moreBack Ask Mageplaza