Introduction

 

Developer Preview
APIs in Developer Preview are subject to change and are not intended for use in production.
Send us your suggestions for improving this API. Your feedback is valuable to us.

 

Note: This module is universal. Functions in this module can run on both the backend and frontend, unless specified otherwise.

The Activity Counters module allows you to keep track of site members' activity. See "Integrations" below for Wix App activities that are already counted.

The service allows public and private counters:

  • Public counters can be read by any site member.
  • Private counters can only be accessed by the site member who owns the counter.

The Activity Counters API gives you access to the counters on a site at a per-member, per-app level.

Counters are only activated when a site member actually performs the activity the counter tracks.

This means that the query and list endpoints for this API may return a large number of results, for sites with many members.

Integrations

Activity Counters is currently integrated with these Wix apps and features:

Wix Blog

Wix Blog counts blog posts, comments, and likes.

Wix Forum

Wix Forum counts forum posts, comments, likes, and views.

Wix Members Area

Wix Members Area counts followers in both directions (followed by / following).

Access

Third-party developers can

  • read (but not set) public counts from any apps.
  • read and set all counts for their own apps.

Initializing a counter

To create a new counter for an app, use the Set Activity Counters function.

Use cases

Most active writer widget. You want to add a "most active writer" widget to your home page, based on the number of posts each member creates.

  1. Get per-member post numbers for blog or forum app using the Get Activity Counters function.
  2. Process counts and display in widget.

Most influential member widget. You wants to add a "most influential members" widget to your community, based on how many likes and comments each member's posts gets.

  1. Get per-member reaction numbers for blog/forum app using Get Activity Counters function.
  2. Process counts and display in widget.

Import statement

To use Wix Marketing Tags, import { activityCounters } from the wix-activity-counters.v2 module:

Copy
Was this helpful?
Yes
No