Search.../

ActiveCampaign Integration

The ActiveCampaign Integration package allows you to integrate Wix Stores with the e-commerce marketing automation service, ActiveCampaign.

With this package you can set up a 3rd-party integration (connection) for your Wix Store in ActiveCampaign. When a customer submits payment for a new order in your Wix Store, the order information is sent to ActiveCampaign. ActiveCampaign creates a customer profile with the order information, or adds the order information to the existing customer’s profile.

Setup

Before using the package, set up the following:

ActiveCampaign Platform

  1. Go to the ActiveCampaign site and complete the registration process, or sign in if you already have an ActiveCampaign account.
  2. On the dashboard, go to Settings > Developer and get the following information from the API Access section:
    • URL
    • Key

Wix Platform

Secrets Manager
  • Open the Wix Secrets Manager and create a new secret with the name velo-activecampaign-key. Store your ActiveCampaign key in the secret.
Wix Stores
  • Add a Wix Store to your site.
Configurations

Do the following in your config.json backend file to create a connection from your Wix Store to ActiveCampaign:

  1. Set the apiAccessUrl value to your ActiveCampaign API Access URL.

  2. Set the properties of the initData object to the values specified below.

    • service: The name of your service (for example, Wix Store).
    • externalid: The ID of your store. Must be a string (for example, ’myWixStoreId’.
    • name: The name associated with the account such as your company name (for example, ’Toys Store’).
    • logoUrl: The image URL of your store logo.
    • linkUrl: Link to a URL where your integration can be managed. For example, you can link to the Wix Store Products page in your Dashboard. The link is for tracking purposes.

Note that the information you define in the config file will be displayed as follows in your ActiveCampaign Integrations panel once you finish creating a connection. To get to the Integrations panel, on the left side of your dashboard click Settings > Integrations.

alt_text

  1. Set the id value. You will get this value after you create your connection. Follow these steps to create your connection:

    a. Create a new '.js' file in the backend section of your site (for example, ‘test.js’).

    b. Add the following code to this file:

    import { createConnection } from '@velo/wix-stores-activecampaign-backend';
    export function init() {
    return createConnection();
    }
    js | Copy Code

    c. To run this function from the Editor, click the green arrow next to the function. A new tab will open in the code panel for running the function.

    alt_text

    d. Click Run in the right column to run the function. You will find your id in the function output. This is your connection ID. Set it as the id value in the config.json file.

    alt_text

Package Content

The following backend files are included in the package. Note that only exported package functions that you can use in your site are listed here.

config.js

The code in this editable file contains the configurations needed to use this package. Follow the instructions in the Setup section to set up the configurations.

activecampaign-api.js

The code in this file defines functions used to work with the ActiveCampaign API.

create-connection.js

The code in this file contains a function that uses the information you set in your config.js file to create a 3rd-party integration (connection) for your Wix Store in ActiveCampaign API.

events.js

The code in this file contains an event that calls the orderHandler() function to handle and send a customer’s order information from your Wix Store to ActiveCampaign upon payment of a new order. This file contains the following function:

  • wixStores_onOrderPaid(event)

    Sends customer order information (customer number and ID) to ActiveCampaign when a customer submits payment for a new order in your Wix store.

    export async function wixStores_onOrderPaid(event)
    js | Copy Code

order-handler.js

The code in this file contains functions that handle orders and send them to ActiveCampaign.

test-order.js

The code in this file contains a function that creates a test order from your Wix Store. You can run this function before your site is live to make sure the package is working properly.

  • makeTestOrder()

    Creates a test order from your Wix Store and sends it to ActiveCampaign.

    async function makeTestOrder()
    js | Copy Code

How to Use the Package

This section demonstrates how you can work with the package. Note that this package does not require you to add any code. To use this package, you need to complete all steps of the Setup section.

Once a customer submits payment for an order, you should see the order in your ActiveCampaign site. To see the order, click Contacts and then click the contact whose order you want to see. In the example below, you can see Jane Doe’s order made from our Wix Toys Store.

alt_text

To test the package and see orders from your Wix Store in ActiveCampaign without a customer order, follow the steps below:

  1. Complete the steps in the Setup section, if you haven't already.

  2. Create a new '.js' file in the backend section of your site (for example, ‘order.js’).

  3. Add following code to this file:

    import { makeTestOrder } from '@velo/wix-stores-activecampaign-backend';
    export function test() {
    return makeTestOrder();
    }
    js | Copy Code
  4. To run this function in the Editor, click the green arrow next to the function like you did in step 3c. of the Setup.

  5. Click Run in the right column to run the function. The function will run a test order with sample customer information listed in the package’s test.js file.

  6. Check the order by going to ActiveCampaign > Click Contacts and you should see our test order under the email address, ‘john.doe@somedomain.com’.

npm Packages

This Velo package uses the following npm package. To view the npm license, see the npm readme.

Release Notes

1.0.0 Initial version.

1.6.0 Add Name and Phone Syncing.

Tags

wixStores, activeCampaign, e-commerce, marketing, automation

Was this helpful?