Activity counters track site members' activities across Wix apps.
The Activity Counters API allows you access Wix site members' public activity, and manage activity counters for an app.
When developing websites, if you set activity counter data using elevation, the action is assigned to the generic Wix code backend app.
See Integrations for activities that are counted from apps made by Wix.
151e476a-715e-ec33-db9a-a7ff4d51f70a
.Activity Counters is currently integrated with the following apps made by Wix:
This article shares some possible use cases your implementation could support, as well as an example flow that could support each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your implementation.
You can display the "most influential members" data to a site page or dashboard page, based on how many likes and comments each member's posts get.
Create a counter for customer activities you consider to be highest priority, for example purchases, and display "high priority customer" data in a dashboard page, displaying the site members with the highest numbers of high-priority actions.
key
for each.Activity Counters service APIs
Member ID.
App ID.
When developing websites, if you set activity counter data using elevation, the action is assigned to the generic Wix code backend app: 151e476a-715e-ec33-db9a-a7ff4d51f70a
.
Counters for this member.
{
"memberId": "987110f7-5100-4beb-a948-de610fd18f00",
"appId": "7eb67052-4478-416e-b444-eff7accf6cea",
"counters": [
{
"key": "This is key",
"public": true,
"count": 1
}
]
}
Sets activity counters for a requested site member.
If the counter does not already exist, it will be created.
Counters are identified with a custom key, which must be unique.
Note: Make sure to pass a memberId
and not a contactId
to identify the member. Any relationship between a member's memberId
and contactId
is coincidental.
You can only call this method when authenticated as a Wix app or Wix user identity.
Member ID whose counter will be set.
Counter data for this site member.
Updated activity counter.
curl -X PUT \
https://www.wixapis.com/members/v1/activity-counters/bc93bbe5-228e-4468-a9ac-ebc15f90427e \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: <AUTH>' \
-d '{
"memberId": "bc93bbe5-228e-4468-a9ac-ebc15f90427e",
"counter": {
"key": "My custom key",
"public": true,
"count": 10
}
}'
{
"activityCounter": {
"memberId": "bc93bbe5-228e-4468-a9ac-ebc15f90427e",
"appId": "fb70a122-6276-4bbd-9cc6-ea9bc452b2a1",
"counters": [
{
"key": "This is my public key",
"public": true,
"count": 1
},
{
"key": "My custom key",
"public": true,
"count": 10
}
]
}
}
Retrieves activity counters for the specified site member, including all public counters and any private counters owned by the authenticated caller.
Note: Make sure to pass a memberId
and not a contactId
to identify the member. Any relationship between a member's memberId
and contactId
is coincidental.
Member ID whose counters will be returned.
Activity counters.
curl -X GET \
https://www.wixapis.com/members/v1/activity-counters/987110f7-5100-4beb-a948-de610fd18f00 \
-H 'Authorization: <AUTH>' \
{
"activityCounters": [
{
"memberId": "987110f7-5100-4beb-a948-de610fd18f00",
"appId": "7eb67052-4478-416e-b444-eff7accf6cea",
"counters": [
{
"key": "This is public key",
"public": true,
"count": 3
}
]
},
{
"memberId": "987110f7-5100-4beb-a948-de610fd18f00",
"appId": "fb70a122-6276-4bbd-9cc6-ea9bc452b2a1",
"counters": [
{
"key": "This is private key",
"public": false,
"count": 10
},
{
"key": "This is another public key",
"public": true,
"count": 10
}
]
}
]
}
Returns up to 100 public activity counters for the provided filter and paging.
Only counters that are marked as public are returned.
Supported fields for filtering:
memberId
Supported operations:
Comparison:
Logical:
Query options.
Retrieved activity counters.
Paging metadata.
Retrieving counters with member id
curl -X POST \
https://www.wixapis.com/members/v1/activity-counters/query \
-H 'Authorization: <AUTH>' \
-d '{
"query": {
"filter": {
"memberId": "987110f7-5100-4beb-a948-de610fd18f00"
}
}
}'
{
"activityCounters": [
{
"memberId": "987110f7-5100-4beb-a948-de610fd18f00",
"appId": "7eb67052-4478-416e-b444-eff7accf6cea",
"counters": [
{
"key": "This is public key",
"public": true,
"count": 3
}
]
},
{
"memberId": "987110f7-5100-4beb-a948-de610fd18f00",
"appId": "fb70a122-6276-4bbd-9cc6-ea9bc452b2a1",
"counters": [
{
"key": "This is another public key",
"public": true,
"count": 10
}
]
}
],
"metadata": {
"count": 2,
"offset": 0,
"total": 2
}
}
Triggered when a member's activity counter is updated.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.members.v1.activity_counter
.
Event name. Expected updated
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.members.v1.activity_counter_updated",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "4916088b-3bde-4666-826b-2f72e239d58c",
"entityFqdn": "wix.members.v1.activitycounters",
"slug": "updated",
"entityId": "987110f7-5100-4beb-a948-de610fd18f00",
"updatedEvent": {
"currentEntity": {
"memberId": "987110f7-5100-4beb-a948-de610fd18f00",
"appId": "7eb67052-4478-416e-b444-eff7accf6cea",
"counters": [
{
"key": "This is key",
"public": true,
"count": 1
}
]
}
},
"eventTime": "2021-09-16T14:09:25.585986Z",
"triggeredByAnonymizeRequest": false
}