Auto Login

Overview

WP Fusion’s auto-login system can load the CRM tags and meta data for a contact record into a temporary WordPress user account. The site visitor is then tracked with a cookie.

This allows you to personalize site content, pre-fill forms, and track activity (by applying tags) even if the contact doesn’t have a WordPress account.

The auto-login process can either be triggered via a link, or via a form submission.

Note: This feature does not always work properly on WP Engine or other hosts that don’t let you edit your site’s caching settings.

Auto Login Links

Auto login links can be used in an email to grant access to restricted content on your site without requiring a user to log in. You can even grant access to contacts in your CRM that don’t have user accounts on your site.

Keep in mind that the user will only be logged in for the purposes of WP Fusion’s content restriction and activity tracking features. For security reasons, users will not be able to access or edit their account details, purchase history, or any other sensitive information. For that they will need to log into your site using their username and password. All other plugins will see the visitor as a guest.

Usage

To use this feature, first enable it from the Advanced section of the WP Fusion general settings tab.

url-login

You can now log a user into your site by passing a contact ID in any URL pointed at your site, for example:

http://mysite.com/my-special-content/?cid=1234

This sets a cookie and creates a temporary WordPress user with that contact’s tags and other information from your CRM. Any protected content will be accessible if the contact has the correct tags. You can also apply tags and track activity as if the user was logged in.

You can also use WP Fusion’s user meta shortcodes to display contact data from your CRM.

Personalization tags

Here are some of the personalization tags for our more popular CRM integrations. This list will continue to be updated:

  • ActiveCampaign: http://mysite.com/?cid=%CONTACTID%
  • AgileCRM: http://mysite.com/?cid={{id}}
  • ConvertKit: http://mysite.com/?cid={{ subscriber.id }}
  • Drip: http://mysite.com/?cid={{ subscriber.id }}
  • HubSpot: http://mysite.com/?cid={{ contact.email }}
  • Infusionsoft: http://mysite.com/?cid=~Contact.Id~
  • Mailchimp: http://mysite.com/?cid=*|EMAIL|*
  • Mautic: http://mysite.com/?cid={contactfield=id}
  • NationBuilder: http://mysite.com/?cid={{recipient.id}}
  • Ontraport: http://mysite.com/?cid=[Contact ID]

For other CRMs you can find the merge field for the contact ID from their merge fields documentation.

Form Auto Login

You can also start an auto-login session when a form is submitted with any one of our supported form plugins.

This is the same as if the visitor had just followed an auto-login link— a cookie is set and then you can customize the site appearance based on the tags and meta data on their contact record.

To enable this, check the box for Form Auto Login from the Advanced settings tab.

Ending auto-login sessions

WP Fusion will attempt to end the auto login session in several situations to prevent unexpected behavior on your site:

  • When a user logs into the site with a username and password
  • When a visitor reaches a page that contains “login” in the URL
  • When a visitor reaches a page that contains “register” in the URL
  • When a visitor reaches a page that contains “checkout” in the URL

However you may also want to force the auto-login session to end at a different time, for example when a form is submitted. You can do this by appending ?wpf-end-auto-login=true to any URL.

You can also achieve this in PHP by calling wp_fusion()->auto_login->end_auto_login();