Using Analytics Shortcodes

Display analytics data anywhere on your site using shortcodes. Site owners can use these to create custom analytics dashboards or author leaderboards.

What You’ll Learn

  • Available analytics shortcodes
  • Shortcode attributes and options
  • Where to place shortcodes
  • Example use cases

Main Analytics Shortcode

[bp-member-blog-analytics]

Displays the full analytics dashboard for the current logged-in user.

Attributes

AttributeDefaultDescription
user_idCurrent userShow analytics for a specific user
days30Number of days to display
show_chartyesDisplay the views chart
show_sourcesyesDisplay traffic sources
show_top_postsyesDisplay top posts list

Examples

Basic usage – show current user’s analytics:

[bp-member-blog-analytics]

Show last 7 days only:

[bp-member-blog-analytics days="7"]

Show specific user’s analytics (by user ID):

[bp-member-blog-analytics user_id="5"]

Chart only, no lists:

[bp-member-blog-analytics show_sources="no" show_top_posts="no"]

Post Views Counter Shortcode

[bp-member-blog-views]

Displays view count for a specific post. Use inside post content or templates.

Attributes

AttributeDefaultDescription
post_idCurrent postShow views for a specific post
formatnumberDisplay format: number, text, or icon
label(empty)Text to show before the count

Examples

Show views for current post:

[bp-member-blog-views]

With a label:

[bp-member-blog-views label="Views: "]

Text format (includes “views” word):

[bp-member-blog-views format="text"]

Output: “1,234 views”

Specific post:

[bp-member-blog-views post_id="123"]

Author Stats Shortcode

[bp-member-blog-author-stats]

Displays summary statistics for an author.

Attributes

AttributeDefaultDescription
user_idCurrent userShow stats for specific user
show_postsyesShow total post count
show_viewsyesShow total views
show_avgyesShow average views per post
layoutinlineDisplay layout: inline, grid, or vertical

Examples

Basic author stats:

[bp-member-blog-author-stats]

Grid layout with all stats:

[bp-member-blog-author-stats layout="grid"]

Views only:

[bp-member-blog-author-stats show_posts="no" show_avg="no"]

Top Authors Leaderboard

[bp-member-blog-top-authors]

Displays a leaderboard of top authors by views or post count.

Attributes

AttributeDefaultDescription
count10Number of authors to show
orderbyviewsSort by: views, posts, or average
days30Time period to consider
show_avataryesDisplay author avatars
show_statsyesShow view/post counts

Examples

Top 5 authors this month:

[bp-member-blog-top-authors count="5" days="30"]

Most prolific authors (by post count):

[bp-member-blog-top-authors orderby="posts"]

All-time top authors:

[bp-member-blog-top-authors days="0"]

Where to Use Shortcodes

On Pages

Create a dedicated analytics or leaderboard page:

  1. Create a new page
  2. Add the shortcode to the content
  3. Publish the page

In Widgets

Add to sidebars or widget areas:

  1. Go to Appearance → Widgets
  2. Add a Text or Custom HTML widget
  3. Paste the shortcode
  4. Save

In Theme Templates

Use PHP to output shortcodes in templates:

Example Use Cases

Author Profile Page

Show author stats on their profile:

My Stats

[bp-member-blog-author-stats layout="grid"]

My Top Posts

[bp-member-blog-analytics show_chart="no" show_sources="no"]

Community Leaderboard Page

Top Authors This Month

[bp-member-blog-top-authors count="10" days="30"]

All-Time Leaders

[bp-member-blog-top-authors count="5" days="0"]

Sidebar Widget

Top Contributors

[bp-member-blog-top-authors count="5" show_stats="no"]

Styling Shortcode Output

All shortcodes output elements with CSS classes for customization:

/* Analytics container */
.bp-member-blog-analytics { }

/* Views counter */
.bp-member-blog-views { }

/* Author stats */
.bp-member-blog-author-stats { }

/* Top authors list */
.bp-member-blog-top-authors { }
.bp-member-blog-author-item { }

Related Docs

  • How to Navigate Your Author Dashboard
  • Understanding Your Post Analytics
  • All Shortcodes Reference (Free Plugin)
]]>
Last updated: January 18, 2026