Skip to main content

Using Autologin With WordPress

Overview

The ActiveMember360 Autologin module allows logged in users on one WordPress ActiveMember360 site (the FROM site) to autologin to another WordPress ActiveMember360 site (the TO site) using an autologin URL within an HTML link, providing both sites connect to the same ActiveCampaign application.

Usage

The URL used for autologin is constructed using your site URL and parameters.

A sample of the URL structure required is as follows:

site_url/?mbr_autologin=my_security_code&id=[mbr_db_id]

The ActiveCampaign contact must already exist within both WordPress sites as a user for the autologin URL to function. Otherwise the contact will not be logged in.

The autologin URL is used in HTML links on the WordPress site the user will be currently logged in to i.e. the FROM site not the TO site.

Site URL & Parameters

Site URLDescription
site_urlThe WordPress site URL where the user is to be automatically logged in i.e the TO site. This can be found in WordPress, Settings, General, Site URL. It must be specified exactly as shown there.
Default: none.
Required: yes.
ParametersDescription
mbr_autologinSet to the security code used to validate an autologin. The security code used must be defined as detailed in ActiveMember360, Settings, Security, Security Codes. This code must be defined on the TO site.
Default: none.
Required: yes.
emailThe ActiveCampaign contact email address of the contact to be logged in.
Permitted value: [mbr_db_email]
Default: none.
Required: dependent upon use case, see Examples.
idThe ActiveCampaign contact ID of the contact to be logged in.
Permitted value: [mbr_db_id]
Default: none
Required: dependent upon use case, see Examples.
add_tagsOne or more tag ID's defined within ActiveCampaign to add to this contact during the auto-login process. If more than one is entered, please separate with commas. Tag ID's can be determined as explained in Determine ActiveCampaign Tag IDs.
Default: none.
Required: no.
remove_tagsOne or more tag ID's defined within ActiveCampaign to remove from this contact during the auto-login process. If more than one is entered, please separate with commas. Remove tags are processed before add tags. Tag ID's can be determined as explained in Determine ActiveCampaign Tag IDs.
Default: none.
Required: no.
assign_automationsOne or more automation ID's defined within ActiveCampaign to which the contact should be added during the auto-login process. To assign to multiple automations, separate them with commas. Automation ID's can be determined as explained in Determine ActiveCampaign Automation IDs.
Default: none.
Required: no.
remove_automationsOne or more automations ID's defined within ActiveCampaign from which the contact should be removed during the auto-login process. To remove from multiple automations, separate them with commas. Remove automations are processed before assign automations. Automation ID's can be determined as explained in Determine ActiveCampaign Automation IDs.
Default: none.
Required: no.
subscribe_listsOne or more list ID's defined within ActiveCampaign to which the contact should be subscribed during the auto-login process. To subscribe to multiple lists, separate them with commas. List ID's can be determined as explained in Determine ActiveCampaign List IDs.
Default: none.
Required: no.
unsubscribe_listsOne or more list ID's defined within ActiveCampaign from which the contact should be unsubscribed during the auto-login process. To unsubscribe from multiple lists, separate them with commas. Unsubscribes are processed before subscribes. List ID's can be determined as explained in Determine ActiveCampaign List IDs.
Default: none.
Required: no.
redirSends the user to the URL of your choice after a successful login. To use URL parameters with the redirect URL please refer to [Using URL parameters with the Autologin module redir parameter][autologin-redirect-url-parameters]. This is a location on the TO site.
Default: none.
Required: no.
nofirstloginIgnore First login redirect specified in ActiveMember360, Settings, Login, Page redirect on first login. This is a setting on the TO site.
Permitted values: Any value will ignore first login
Default: none.
Required: no.
Important

When using the email parameter an email address can only contain the plus character + if it is URL encoded i.e. replaced by %2B.

Otherwise it will be decoded by the PHP $_GET into a space and break the autologin URL.

For this reason we recommend that the id parameter is used rather than email parameter.

The adding/removing of tags, assigning/removing of automations and subscribing/unsubscribing to lists will be processed irrespective of whether the autologin is successful.

Examples

Important

In all examples my_security_code must be replaced by a security code defined in ActiveMember360, Settings, Security, Security Codes on the TO site.

Upon a successful login they will either be redirected to the home page, or to the appropriate page defined in ActiveMember360, Settings, Memberships, Redirect on login or if it’s their first login to the page selected in ActiveMember360, Settings, Login, Page redirect on first login:

https://yoursite.com/?mbr_autologin=my_security_code&id=[mbr_db_id]