View tracking — the capture pipeline
Every time a logged-in member browses to another member’s profile, the plugin’s capture pipeline runs. It hooks into the_content (only firing when the request resolves to a single user profile via bp_is_user()), checks dedupe rules, respects per-user opt-outs, and inserts a row into {prefix}bp_profile_views.
How a visit becomes a row
Section titled “How a visit becomes a row”- The member opens a profile.
- The pipeline checks
bp_profile_views_general_options['save_count_by']:session— dedupes via the user metabp_profile_views_user_login_session, keyed by login session token, stamped per displayed user per calendar day. Same viewer revisiting the same profile inside the same login session counts once.referer— dedupes via the transientbp_profile_views_referer_transientplus cookies (BP_PROFILE_VIEW_REQUEST_URIandBP_IS_USER). Same viewer revisiting the same profile within 6 hours counts once.
- The pipeline reads the visitor’s
visitor_settinguser meta. If it’s'no'(the user has opted out), no row is recorded. - Logged-out visitors are recorded with
viewer_id = 0. Theexclude_logout_user_countoption filters those rows out of every aggregate query at read time — they’re stored, but invisible. - Bot User-Agents (Googlebot, Facebot, LinkedInBot, Pingdom, curl, etc.) are filtered out before the row is inserted. New in 1.5.0.
- After insert, the action
bp_profile_views_after_insertfires with the new row ID.

Where to tune capture behaviour
Section titled “Where to tune capture behaviour”- Dedupe strategy — General tab → “How views are counted”.
- Exclude logged-out viewers — General tab → “Viewer types”.
- Per-user opt-out — General tab → “Member control” (admin-side); profile Views tab toggle (member-side).
See General tab for the full list and defaults.
Recorded vs. counted
Section titled “Recorded vs. counted”The plugin always records every qualifying view in the database. What gets counted in aggregates and shown in the UI depends on your settings:
exclude_logout_user_count = yes→ logged-out rows (viewer_id = 0) are excluded from counts and the Views tab.- A user with
visitor_setting = 'no'→ their visits are not even recorded going forward. - The dedupe strategy controls whether repeated visits create new rows or are skipped.
This means:
- The raw row count in
{prefix}bp_profile_viewsis always ≥ the count shown anywhere in the UI. - Turning
exclude_logout_user_countoff later doesn’t backfill — old anonymous rows simply become visible. - Re-enabling tracking for a user who opted out doesn’t recreate visits they made while opted out.
Extending
Section titled “Extending”To forward each view to an analytics service or trigger custom logic, hook the action bp_profile_views_after_insert. See Hooks and filters.

