Back to Tips & Tricks

Track Profile Views in ProfileBuilder with a JetEngine-Powered Shortcode (No Plugin Bloat)

Published on 25 August 2025

Want to show how many times each user profile has been viewed—without a heavy analytics plugin? Here’s a clean, copy-paste solution using a simple PHP snippet, AJAX, and a shortcode you can drop right into your Profile single page. It works with ProfileBuilder and stores counts in user meta, updating only once per visitor per 24 hours to avoid spammy repeat hits.

What You’ll Build

A PHP snippet you can add via your favorite snippets plugin

An AJAX endpoint that increments the view count safely

A shortcode [user_profile_view_count] to display the number on the profile page

Smart logic that accepts user ID, username, or nicename from the URL

Prerequisites

WordPress + ProfileBuilder (for user profiles)

JetEngine (we’re following its naming/usage patterns)

A snippets plugin (e.g., Code Snippets, WPCode)

Your Profile single page must pass a user identifier in the URL (e.g., jet_pb_user=123 or slug/username)

Step 1: Create a PHP Snippet

Copy the full code below.

Create a new snippet in your snippets plugin.

Paste the code, set it to run on the front end, and save/activate.

Track Profile Views in ProfileBuilder with a JetEngine-Powered Shortcode (No Plugin Bloat) - BoostMyCroco