Search for answers:
Customer Notices: WordPress 4.5 Affects LiveEditor Functionality - See this article WordFence Plugin Affects LiveEditor - See this article

Add Users To OptimizeMember Using ActiveCampaign Automation

In this guide we will show you how to use the OptimizeMember API to add users to your membership site when using the OptimizeMember plugin, and an ActiveCampaign Automation.

This is somewhat advance but is not much different than other guides we have that use the OptimizeMember API. If you are familiar with those this will be easy. 

Before starting, please make sure you have a general understanding of how ActiveCampign Automations work. You can read these guides from them on how to use Automations.

You can trigger an automation any way you like (with a tag, list, or other methods).

Step 1: Lets build the URL that you'll need to use.

First, you'll need to get your site URL and OptimizeMember API key. 

To get the site URL, go to your WordPress Dashboard and then go to "Settings > General" - you will need to copy and paste your site URL into a notepad/document as we'll start with that. For this example we'll use https://example.com/

ac-webhook-1.png

You'll also need to have the OptimizeMember API and add that to the end of the URL.

https://example.com/?optimizemember_pro_remote_op_integration=1

Next, we'll tell OptimizeMember we need to create a new user by adding &op=create_user to the URL.

https://example.com/?optimizemember_pro_remote_op_integration=1&op=create_user

Now we need to get the API key for OptimizeMember. 

Go to your WordPress Dashboard and navigate to "OptimizeMember > API Scripting > Pro API For Remote Operations"

ac-webhook-2.png

Now we are going to add this to the URL by adding &api_key=1234567890abc

https://example.com/?optimizemember_pro_remote_op_integration=1&op=create_user&api_key=1234567890abc

Just change out the 1234567890abc with your own OptimizeMember API key.

Use the following Query Strings to add user details from ActiveCampaign. Note that we are using merge tags from ActiveCampaign which can be found in their guide.

&data[user_login]=%EMAIL%
&data[user_email]=%EMAIL%
&data[first_name]=%FIRSTNAME%
&data[last_name]= %LASTNAME%

https://example.com/?optimizemember_pro_remote_op_integration=1&op=create_user&api_key=1234567890abc&data[user_login]=%EMAIL%&data[user_email]=%EMAIL%&data[first_name]=%FIRSTNAME%&data[last_name]=%LASTNAME%

Now we need to tell OptimizeMember what level and package(s) to add to the user.

We'll be using the following query strings:

- &data[optimizemember_level]=1 (for level1) - level number (if left empty, 0 will be used) 
- &data[optimizemember_ccaps]=package1,package2,package3 - packages (comma separated if more than one), Don't have to use this one unless you want to add a package (not mandatory).

In this example I want to add a user to Level 3 and add the package "test" so we'll add this to the URL

&data[optimizemember_level]=3&data[optimizemember_ccaps]=test

So now our URL will look like this:

https://example.com/?optimizemember_pro_remote_op_integration=1&op=create_user&api_key=1234567890abc&data[user_login]=%EMAIL%&data[user_email]=%EMAIL%&data[first_name]=%FIRSTNAME%&data[last_name]=%LASTNAME%&data[optimizemember_level]=3&data[optimizemember_ccaps]=test

You will also need the following Query Strings:

&data[notification]=1 (if is set to 1, OPM will email new user with username/password)

&data[modify_if_login_exists]=1 (Set this to 1 to modify if user exists. If data[user_login] is already present in the system, user update will be made),

&method=get (this will tell ActiveCampaign how to send this data to OptimizeMember).

Final URL for sending a webhook to OptimizeMember:

https://example.com/?optimizemember_pro_remote_op_integration=1&op=create_user&api_key=1234567890abc&data[user_login]=%EMAIL%&data[user_email]=%EMAIL%&data[first_name]=%FIRSTNAME%&data[last_name]=%LASTNAME%&data[optimizemember_level]=3&data[optimizemember_ccaps]=test&data[notification]=1&data[modify_if_login_exists]=1&method=get

All the Query Strings that we used are found below:

&op=create_user
&api_key=1234567890abc
&data[user_login]=%EMAIL%
&data[user_email]=%EMAIL%
&data[first_name]=%FIRSTNAME%
&data[last_name]= %LASTNAME%
&data[optimizemember_level]=3
&data[optimizemember_ccaps]=test
&data[notification]=1
&data[modify_if_login_exists]=1
&method=get

Step 2: Setup ActiveCampaign Automation

We won't go into detail on how to setup an automation, but what you'll need to do is select the "WebHook" option: 

Click the "+" button:

ac-webhook-3a.png

Then select "Conditions & Workflow" and finally, "Webhook"

ac-webhook-3.png

Then just pate in the URL that you built in step 1 above:

ac-webhook-4.png

Click the green "Save" button, and make sure your Automation is set to "active" and you should be all set.

It is important to note that you need to ensure the URL and API key are correct. Also, any merge fields you use for first name, last name, email, you'll want to be sure those exist on the contact. If the first name/last name is missing from the user profile in OptimizeMember then you'll need to see which fields you are using and use the appropriate personalization tag.

Step 3: Testing

To test, just simply add a contact to your "contacts" in ActiveCampaign and add them to whatever you are using to trigger the automation and you should see the user added within a few minutes.


If you have further questions about using the OptimizeMember API, please don't hesitate to get in touch with our support team and we'll be happy to help.

Didn't find an answer to your question? Contact Our Support Team (Submit a ticket)
Was this article helpful?
0 out of 0 found this helpful
Follow

Comments

Other Help Categories:

Get Started Guide

Watch our Ultimate Getting Started guide video

Pre-Sales Questions

Ask questions before purchasing our products

Login Problems

If you're having issues logging into our members hub

Accounts & Billing

Update your billing, request a refund and other accounts help

API Key Issues

Get help with licensing your site and API key issues

Membership Help

Get help creating Membership portals and courses

LiveEditor Help

If you need help using or troubleshooting the LiveEditor

Integrations

Find out about the many integrations possible with OptimizePress

Affiliate Questions

Have questions about promoting OptimizePress

Clubhouse Questions

Questions about our Clubhouse Membership Subscription