View a user's profile data inside Wordpress

Learn how to fetch and view user profile data in WordPress while tracking events with Operational for audit and analytics.

Understanding User Profile Viewing in WordPress

Viewing a user’s profile can help admins and plugins show personalized content and track user behavior.

For example, you might want to log when a member views another member’s profile to monitor engagement or detect suspicious activity.

What is Operational

Operational is a lightweight event tracking tool for any tech product.

You can use it to capture events when users view profiles in WordPress.

Operational in action

Setting Up Operational

  1. Go to app.operational.co and sign up for a free account.
  2. Create a new project in your dashboard.
  3. Copy the API key from the project settings.
  4. Install the Operational SDK or prepare your HTTP client.

Tracking Profile Views with PHP

<?php
require 'vendor/autoload.php';

use Operational\\Operational;

$ops = new Operational('API_KEY');

$payload = [
  'name' => 'view user profile',
  'avatar' => '👤',
  'content' => 'User John Smith viewed profile of user with ID 123'
];

$ops->events()->ingest($payload);

This code sends an event to Operational whenever a user views another user’s profile.

Conclusion

Operational makes it easy to track user profile views and gain insights without extra setup.

Learn more at https://operational.co and try examples in the playground.