ACF user registration and data segmentation

In this article we are going to show you how you can use the ACF Pro plugin to create custom user registration forms. We are also going to see how you can use the Users Insights plugin to map and read the ACF user fields. This will allow you to better understand your users, and it will give you a solid basis for the decision-making process.

Most business owners know that all the information you can gather about your customers is valuable. But the basic user registration in WordPress allows no custom data. In fact, the only thing you are guaranteed to know about a user is their username and email. Everything else is optional and very well hidden in the user profile, under the WordPress admin dashboard. So, all these precious bits of information are completely lost once your user sign up leaving no custom data.

Now it’s time for you to change this.

The Advanced Custom Fields (ACF) plugin allows you to easily create sets of custom fields for your WordPress-related data. Usually, it is used for posts and categories, but today you’ll see how it also does a great job in storing user data. We are also going to use the Users Insights plugin, which will help you filter and make sense of all this information.

Therefore, our topics for today are:

  • A brief overview of ACF Pro
  • Adding ACF fields to the user registration form
  • Reading plain text fields with Users Insights
  • Using opt-ins and multiple options
  • Relational data about posts, categories and other users

So let’s get right into it!

A brief Overview of ACF Pro

The Advanced Custom Fields plugin has a free and a Pro version. The Pro version is more robust in terms of options and extensions and has a lot of functions for developers. But you still can do a lot of things with the free version if you are on a tight budget. We have an article showing how to create a custom user profile page to edit user information. And that is done just with the free version.

Anyway, our article today will use the Pro version only. That’s because it requires no custom code to add fields to the user registration page. But that is actually just a tiny fraction of what this plugin can do.

If you’ve ever created custom fields for a post or page you’d greatly appreciate the work behind it. It’s a lot of work to create something as simple as a single field in your posts. And it’s all seamless when using ACF Pro.

The ACF Pro plugins also lets you limit where your field groups will appear. You can limit to certain posts / pages, to all of them, based on their category and so on.

Let’s see some hand on examples now.

 

Adding ACF fields to the user registration form

You can make the ACF fields available in the User Registration form by configuring the Rules for the field group. All you need to do is select the “Show this field group if: User Form is equal to All” option in the “Location > Rules” section. Here is a basic example:

Location set as user register form

Let’s imagine a simple scenario, for example, if you want to collect plain text data from your users. Here are some examples:

  • Job title
  • Company name
  • Industry
  • Social media profiles (twitter, facebook..)
  • Title (Mr, Mrs, Miss…)
  • Secondary email

These are all simple examples, but you probably know others from your own use cases. These are all fields that can have plenty of answers but they are valuable for you nonetheless.

In order to create these fields, go to your Fields Group edit screen and then click “+Add Field”. Fill in your data, just make sure you recall the “Field Name”, as we’ll need this information in a bit. This is our sample data:

Add new fields

And this is how the user registration form looks like, after adding these fields:

Register form with optional fields

 

Reading plain text fields with Users Insights

After adding these fields you’ll need to read this data with Users Insights. In order to do that you’ll need to map your custom fields, so Users Insights will understand that there are some new fields to load. You can do that under Users Insights > Custom Fields.

Remember the Field Name you’ve added for your fields? Well, this time you’ll add it as a Field Key. You can add anything you want in the Field name, as this is just the label for it. In our example this is how our Custom Fields mapping looks like:

Mapping the fields keys

 

And that’s it. The data is now available in the Users Insights table and filters, making it easy to search your users based on it. You can also export your ACF user fields:

Copany filter

With this in mind, you can, for example, search for all users of a certain Company, or that have a certain Job title:

Job title and filtering by company

You could also search for all users who have a secondary email, and add that one to your mailing list, if they have opted in:

Secondary emails

Gathering all this data is great, but sometimes we need to limit the available options when adding them. If you use text fields they can add anything they want, but if you limit their options, your job will be much easier when searching for this data.

Let’s see how you can do that in the next section.

 

Using opt-ins and multiple options

Adding selects, radios or checkboxes is a good idea if the data you want has a limited set of options. For example, a text field for company size may not be as valuable for you as a field with the employees number range. Same for annual revenue or even simple things such as the customer’s Industry.

You might also need to collect simple Yes / No answers, such as mailing lists opt-ins. And maybe you need to add date pickers (date of birth).

These are all different field formats that ACF Pro supports, and that will make your life much easier when reading this data with Users Insights.

Here is a simple example of the register form with Mailing and Industry fields:

Newsletter checkbox in the register form

Now it’s much easier to filter all users from a certain industry (for example automotive) and add them all to a user group in bulk.

Industry bulk add to group

You could also segregate your newsletter by industry so it’ll be more relevant to your customers. This allows you to greatly increase your results with them, as segmented groups are far easier to reach. It can be done with a simple filter of user who have opted in for a mailing list AND are from group / industry X.

Opted in for newsletter and automotive industry

They key value here is the segregation. When you are speaking to a smaller audience you can tackle their problems directly. For example, the problems you solve for a company with 50 or fewer employees is probably different from what you can do for a company with 5,000 employees.

Another good option to analyze your data is to combine these filters with your order’s data. For example, if you have WooCommerce and the WooCommerce module active you can see the number of orders per industry.

Lifetime value and industry

Taking a step further you could use the customer lifetime value metric, and segment them by industry or company size. This allows you to find the most profitable customer segments so you can focus your marketing efforts on them.

 

Relational data about posts, categories and other users

Finally, it’s also possible to add custom fields for your users that is related to other data you have in WordPress. You could use posts, Custom Post Types, Categories, Custom taxonomies, etc. These are all options that you have by default in ACF Pro.

Here are a few examples of some data you could store:

  • Have store locations as a Custom Post Type and add a field for preferred store
  • Allow users to add themselves to a Users Insights group in the registration form (using_group taxonomy)
  • Create a field for the categories of interest and load all your WooCommerce product categories

After adding your fields and mapping them inside of Users Insights you’ll just see the element’s ID. And that’s fine, that’s the right way to do it. You wouldn’t want to load, for example, just the title to later discover that you need to change your Store location name and see all your old data being lost. So storing just the ID will allow you to always have up to date attributes.

But now we need to load the title of these elements, otherwise, you won’t be able to make sense of them when filtering these with Users Insights. If you don’t do this, all you will see is the ID of that element. We have another article on how to convert your user meta fields into a readable format, but we’ll show you an example here.

Let’s say you allow your users to add store locations to their profiles, and you’ve mapped that field with the key “store-location”. In order to load the title of your stores instead of the ID we need some PHP code. We can use this snippet in your theme functions or a child theme functions file to load the title for that element:

This code will just check when the current field key is “store-location”. If that’s the case instead of showing the ID, it’ll look for the title of that post and return it instead. So instead of 237 you’d see “Main Avenue Store”, for example.

 

Conclusion

Today we dived into the world of custom user registration fields with ACF Pro and how to read this data with Users Insights. We saw various methods of storing your data and ways to retrieve them and format them correctly. We also talked about the relevance of having custom user fields and how you can increase your marketing results with personalized and segmented content.

We hope you enjoyed it and see you again next time!