How do I connect VTEX to ActiveCampaign?

:bulb:CX Tips is part of our community tips series, where we post some of the most commonly asked questions we hear from ActiveCampaign customers. Have a new question? Start a new topic by clicking +New Topic in the upper right hand corner!

Use the ActiveCampaign VTEX integration to sync contacts, website visits, and purchase data from your VTEX store to ActiveCampaign.

Take note

  • You need an ActiveCampaign account and a VTEX account to use this integration
  • Ensure the VTEX environment you intend to install the app on is set up with a website host under “Store” on https://{AccountName}.myvtex.com/admin/license-manager/#/account-details NOTE: If you visit this page and see a blank screen, you will need to ask for Owner (Admin Super) access to the VTEX account or access to the “License Manager” screens in VTEX to verify the host is set up
  • Ensure that you have access to “Master Data” in the VTEX admin
  • Contacts synced to ActiveCampaign from VTEX receive the following tag: VTEX-customer
  • To sync opt-in marketing information to ActiveCampaign, you must create a custom contact field in the ActiveCampaign called “Accepts Marketing.” You can use this field to sync the “I want to receive the newsletter” checkbox data from VTEX checkout. Read the “Create a custom contact field from the Manage Fields page” section of the Custom Contact Field Overview help article to learn how to create this field
  • ActiveCampaign accounts created on or after January 8, 2024: contacts synced in from the VETEX integration that have checked the “I want to receive the newsletter” checkbox will be added to the Master Contact List by default. If you delete or change the name of the ActiveCampaign-created Master Contact List, contacts will not be added to any lists. To add contacts to a list, you will need to create an automation
  • Some of this setup requires the implementation of code. Our Customer Experience Team is not able to help you create or troubleshoot code

About the ActiveCampaign VTEX integration

The ActiveCampaign VTEX integration configuration steps take place in your VTEX account. Once all steps in each section below are complete, the following will sync to your ActiveCampaign account:

  • Website visits (uses ActiveCampaign Site Tracking)
  • Purchase data
  • Abandoned cart data
  • Customer data
  • Order data
  • Data of “I want to receive the newsletter” checkbox from VTEX checkout to facilitate GDPR compliance (requires configuration of a custom contact field in ActiveCampaign)

All purchase and abandoned cart data will appear in an Ecommerce box on the contact record.

Once you have this data in your account, you can use ActiveCampaign to:

  • Create abandoned cart automations using the Abandoned Cart automation trigger and Abandoned Cart email content block. For more information, read the “Abandoned Cart Deep Data Overview” help article
  • Personalize direct and automated with contact and order information
  • Segment contacts by website visits, purchase data, abandoned cart data, and more

Connect VTEX to ActiveCampaign

This configuration takes place in your VTEX account.

  1. Install the activecampaignpartnerus.activecampaign app in the desired VTEX environment. To do so, go to Apps > App Store in VTEX admin. Select the ActiveCampaign app and then click Install.
  2. In the VTEX admin’s account, go to Apps > My Apps and select the ActiveCampaign box.
  3. Once on the app’s settings page, define the app’s configurations:
  • ActiveCampaign Account name. Your account name is on the Settings > Account page in your ActiveCampaign account. For example, If your account is xyz123.activehosted.com, you would only enter xyz123 as the Account Name in VTEX
  • ActiveCampaign API URL and Key
  • ConnectionID. Leave this field blank
  1. Click Save.
  2. Next, find the ActiveCampaign Menu.
  • On the “older” VTEX admin, it is In the VTEX admin sidebar under Products
  • On the “newer” VTEX admin, it is on the Apps menu slideout under Installed Apps
  1. Click ActiveCampaign > Connection ID Configuration
  • Click Configure
  • Wait for the fields to populate
  • Click the External ID dropdown, then select your store ID
  • Click the Link URL dropdown, then select the store URL
  • Click Continue Configuration. You will see the message “Account has been updated.” The page will refresh and display the App Settings page. Your ConnectionID is now populated
  1. Click Save.
  2. Click on ActiveCampaign > Purchase Data Configuration
  • Tracking setAccountID - Enter the 3-letter ISO currency code for your store (such as USD for United States Dollars)
  • Send Purchase Data (optional)- Click the checkbox next to Send Purchase Data if you wish to sync orders to ActiveCampaign
    • This option sends customer data, including the “accepts_marketing” field and order data, to ActiveCampaign when the customer reaches the Order Confirmation page and if payment has been captured. If ActiveCampaign does not receive the order data, the order will be sent to ActiveCampaign when it is invoiced in VTEX
  • Fulfillment orders do not sync into ActiveCampaign
  1. Click Save. You will see a confirmation message.
  2. Click on ActiveCampaign > Connections.
  • This information should match your Connected Integrations in your ActiveCampaign account
  • To confirm this, log into your ActiveCampaign account, then navigate to Settings > Integrations. You should see the message “Your integration is successfully connected” on this page

Turn on Site Tracking and whitelist your domain(s) (optional)

This integration uses ActiveCampaign’s Site Tracking feature. You do not need to add site tracking code to your site.

However, you need to add your tracking ID to the VTEX app’s settings under “Tracking setAccount ID.” The integration adds the Site Tracking code for you automatically. You still need to turn on the Site Tracking feature and whitelist your domain(s) on the Website > Site Tracking page in your ActiveCampaign account. To do so:

  1. Click Website in your ActiveCampaign account.
  2. Click Site Tracking.
  3. Click the Site Tracking toggle to set it to the “On” position.
  4. Type or page your web domain into the Website URL field, then click the Add button.
  5. Copy the setTrackAccount ID number from the tracking code snippet and paste it into the settings of the VTEX app.

Abandoned Cart Sync Configuration (optional)

Some of the terms listed in this section are in Portuguese. This is because the Portuguese language is used within the VTEX app. This article reflects the app’s terminology.

This integration syncs customer information with their abandoned cart data to ActiveCampaign. You can use this information to send emails to remind your customers about their abandoned carts. To allow this, you must configure an Abandoned Cart Trigger in VTEX.

  1. In the VTEX admin, access Master Data. After logging in to Master Data:
  • Click Advanced Settings
  • Click Data Structure
  • Click Trigger
  • Click Add New
  1. Complete the information as follows:
  • Name - ActiveCampaign Trigger

  • Data Entity - Cliente

  • On the Rules tab:

    • Trigger Rule - O valor de um atributo for alterado
    • Field - Ăšltima sessĂŁo
    • Click Add Filter, then select or enter:
      • Checkout
      • Diferente
      • Finalizado
    • Click Add Filter, then select or enter:
      • Checkout
      • NĂŁo está nulo
    • Click Add Filter, then select or enter:
      • Carrinho
      • NĂŁo está nulo
    • Click Add Filter, then select or enter:
      • Ăšltimo Carrinho
      • NĂŁo está nulo
  • Click the Schedule tab and choose when VTEX will send abandoned cart data to ActiveCampaign. The options are:

    • Run ASAP - this sends the data to ActiveCampaign within about 45 minutes (see note below) after the customer abandons their cart. If you use this setting, depending on your settings in ActiveCampaign, the customer may receive an abandoned cart email even if they have placed an order
    • Schedule on specific date - this setting allows you to enter a particular date to send the data to ActiveCampaign. This is not recommended for abandoned cart emails
    • Schedule on dynamic date - this setting allows you to set a time length that will pass before VTEX sends the data to ActiveCampaign (this is based on the customer’s last session (Data de Ăšltima sessĂŁo). NOTE: Most clients choose this one and set it to 2 hours after the last session

Example:
VTEX_Example.png
Per VTEX documentation: “A page’s session expires in 30 minutes. Only after that time, the system schedules the abandoned cart trigger. In other words, the time to be considered is the session’s time + the trigger schedule.”

* After making your schedule selection, **click the If Positive tab.** Then **select or enter** the following in these fields only:

  * **Action** - Send an HTTP request
  * Under Request Data:
    * **URL** - (enter the URL below, replacing www.yourwebsiteurl.com with your website’s URL) https://www.yourwebsiteurl.com/api/io/activeCampaign/abandonedCart
    * **Method** - POST
    * **Headers: Name** - Content-Type
    * **Headers: Value** - application/json
    * **Content as JSON** - (replace the content that is there with the below content):

{

“rclastcart”: “{!rclastcart}”,

“rclastcartvalue”: “{!rclastcartvalue}”,

“rclastsession”: “{!rclastsession}”,

“rclastsessiondate”: “{!rclastsessiondate}”,

“email”: “{!email}”,

“userId”: “{!userId}”,

“firstName”: “{!firstName}”,

“lastName”: “{!lastName}”,

“localeDefault”: “{!localeDefault}”,

“id”: “{!id}”,

“accountId”: “{!accountId}”,

“accountName”: “{!accountName}”,

“dataEntityId”: “{!dataEntityId}”,

“createdBy”: “{!createdBy}”,

“createdIn”: “{!createdIn}”,

“updatedBy”: “{!updatedBy}”,

“updatedIn”: “{!updatedIn}”,

“lastInteractionBy”: “{!lastInteractionBy}”,

“lastInteractionIn”: “{!lastInteractionIn}”

}
* Under Response Action:
* Data Entity - Cliente
* Parameters: Name - Anexo
* Click the If Negative tab
* No changes are needed here
* Click Save

Customer Sync (optional)

This integration syncs all existing customer data from VTEX to ActiveCampaign, including the “accepts_marketing” field.

Before proceeding with this sync, ensure that your automations, such as Welcome Series emails, are turned off in ActiveCampaign. To learn how to turn off your automations, visit the “How to set automations to “inactive” in ActiveCampaign” help article.

This configuration takes place in your VTEX account.

  1. Click on ActiveCampaign > Customers Sync.
  2. After the page loads, click Sync Customers.
  3. After confirming your automations are disabled in ActiveCampaign, click Continue sync.

A message “Customer Sync has started” will appear on the page.

Order Sync (optional)

This syncs all historical order data from VTEX to ActiveCampaign. Before proceeding with this sync, ensure that your automations turned off in ActiveCampaign.

This configuration takes place in your VTEX account.

  1. Click on ActiveCampaign > Orders Sync.
  2. After confirming your automations are disabled in ActiveCampaign, click Sync all orders.
  3. A dialog box will appear where you can select the date on the calendar you want to use as your sync beginning date. For example, you may wish only to sync the last six months of data instead of all historical orders placed.
    VTEX_dialogue_box.jpeg
  4. Click Continue sync.
  5. A message “Order Sync has started” will appear on the page.
  • Orders placed starting on your beginning date through the current date will sync
  • Order data will sync into ActiveCampaign at about 1000 - 1500 per hour

In addition to syncing all orders, you can choose to sync individual orders manually. To do so:

  1. Enter the order ID that you want to sync into the search box at the top of the page, then click Enter.
  2. Click the checkbox next to the order you wish to sync.
  3. After confirming your automations are disabled in ActiveCampaign, click Sync selected orders.

A message saying “Order Sync has Started” will appear.