If your membership includes an upsell you handle personally, you already have more information about your leads than you are using. Every checkout answer, every visit to your pricing or checkout page, and every membership status sitting in your WordPress database can tell you who is close to buying and who still needs a nudge.

This code recipe turns that information into your own CRM, a system for tracking leads and where they stand in your sales pipeline. It gets built right into your WordPress admin, with no separate tool to buy or connect.

Featured Image for Build a Lead Scoring CRM Report Inside Paid Memberships Pro

Do You Need This Recipe?

This recipe is a good fit if:

  • Your membership includes an upsell you handle personally, like one-on-one coaching, consulting calls, or a premium tier you sell yourself.
  • You want a simple way to see which members are closest to buying, based on what they told you and what they have done on your site.
  • You do not want to pay for or connect to a separate CRM just to get this kind of visibility.

If you already send member data to a CRM like Salesforce, HubSpot, or ActiveCampaign, for example, through an integration like WP Fusion, this recipe will not conflict with it. Everything here stays in your WordPress user meta and does not sync anywhere. It would likely be redundant, though, so this recipe is best suited to sites that do not already have that kind of tool in place.

Before You Start

This recipe requires:

  • A list of the pages on your site you consider high-intent: Your pricing page or checkout page, along with their page slugs, are some examples.
  • Two User Fields created under Memberships > Settings > User Fields: One text field to collect a phone number, and one select field asking members where they are in their buying decision, with your own answer options.
  • The “Name” you set for each field: The unique meta_key WordPress uses to store it. You will match these to the snippet’s configuration.

About the Code Recipe

This recipe has four moving parts that work together.

Profile Answers: A User Fields select field asks members where they are in their buying decision. Each answer is worth a set number of points, defined in the pmprocrm_stages() function. The snippet ships with example answers and scores. You will replace these with your own in the Customize section.

Behavior Tracking: The snippet watches for logged-in members visiting pages you flag as high-intent. It hooks template_redirect to log each visit, and adds that page’s assigned weight to the member’s score. 

Note: Checkout page visits are detected automatically using pmpro_is_checkout(), so you do not need to add a slug for it. You will need to confirm or change any other page slugs in the pmprocrm_tracked_pages() function though.

Score Calculation: The pmprocrm_calculate_lead_score() function combines the profile answer, page-view activity, whether a phone number is on file, and whether the member already holds a paid membership level, into a single number. It recalculates on the pmpro_after_checkout and profile_update hooks, so the score stays current as members act.

Pipeline Report: Paid Memberships Pro renders custom reports with a standard pattern: register a report slug in the $pmpro_reports global, then define a widget function for the reports dashboard, and a page function for the full report. This recipe registers a “Lead Scoring” report under Memberships > Reports, listing every active member ranked by score with a status dropdown next to each one (Unassigned, Qualified, Contacted, Converted, Disqualified, Stale). Choosing a new status saves the change on admin_init, after checking a nonce and a capability so only admins can update it. 

The lead scoring report located in the WordPress Admin under Memberships > Reports.

Note: Moving members between statuses is entirely manual. Nothing here automatically reassigns a status. That is intentional. This recipe gives you a pipeline view, not marketing automation.

The report queries your members’ table directly and caps results at 200, ordered by score. On a site with more than 200 active members, only the top 200 scores will show.

The Code Recipe

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.

How to Customize This Code Recipe

This snippet ships with example configuration for a demo site. Replace these placeholders with your own before using it:

  • Field Names (lines 24-25): The two constants, PMPROCRM_PHONE_META and PMPROCRM_STAGE_META, point to phone and dog_stage. Change these to match the “Name” you set for each of the two User Fields you created in the Before You Start section.
  • Stage answers and scores (lines 34-53): The pmprocrm_stages() function lists example buying-stage answers, like “Ready for one-on-one help,” and a score for each. Replace the array keys with your select field’s answer values, and set your own scores based on how close each answer is to a sale.
  • Tracked pages and weights (lines 64-66): The pmprocrm_tracked_pages() function lists example high-intent pages by their page slugs and their point values. Replace these with the page slugs you identified in Before You Start, along with how many points each is worth. Again, you do not need to change the membership-checkout slug as that one is automatically detected using pmpro_is_checkout().

Other ways to customize this recipe:

  • Score membership level differently: Line 174 gives a flat 10 points to any active paid level. If you have multiple levels and want higher tiers to score higher, check the member’s specific level ID here instead.
  • Raise the 200-member limit: Line 296 caps the report at 200 members. If your site has more active members than that, you can raise this number, but a much higher limit means a much heavier query on every page load of the report. Pagination is the safer fix for a large membership site. It is more involved to build than changing one number, so this is a good place to bring in a developer if you are not comfortable writing it yourself.


Was this article helpful?
YesNo

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Featured Image for Membership Site Development Course: The Basics