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.

Table of Content

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:

Instruction for registering and using ActiveCampaign image 1

Fill your name > Click the Next Step button

Instruction for registering and using ActiveCampaign image 2

Next, Fill your phone number > Click the Next Step button : Instruction for registering and using ActiveCampaign image 3

Complete your company information > Click the Next Step button: Instruction for registering and using ActiveCampaign image 4

Then, choose your favor object by clicking to the checkbox:

Instruction for registering and using ActiveCampaign image 5

After that, fill tools which you are using to the box:

Instruction for registering and using ActiveCampaign image 6

Finally, fill in your password > Click the Take Me To Account button to complete the registration:

Instruction for registering and using ActiveCampaign image 7

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

Instruction for registering and using ActiveCampaign image 8

Next, choose Developer, you will see API URL and Key How To Integrate ActiveCampaign with Magento 2 With Webhook image 1

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

  • Email

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

How to create a new contact in ActiveCampaign via Magento 2 image 1

Step 2: Enter the data on the Action tab

How to create a new contact in ActiveCampaign via Magento 2 image 2 How to create a new contact in ActiveCampaign via Magento 2 image 3

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:

How to create a new contact in ActiveCampaign via Magento 2 image 4

When some events are performed on Store such as adding a new customer, data information will be saved at Hook Logs:

How to create a new contact in ActiveCampaign via Magento 2 image 5

Click Select > View, this will redirect you to the view log page to view data information

How to create a new contact in ActiveCampaign via Magento 2 image 6

The Result Shown At ActiveCampaign

The Result Shown In 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.

Explore Mageplaza Webhook now!






Back Ask Mageplaza

magento-2-tutorial
webhook