1.8.28 • Published 4 years ago

@factor/plugin-server-analytics v1.8.28

Weekly downloads
22
License
MIT
Repository
github
Last release
4 years ago

Factor Server Analytics

This plugin adds tracking of server activity via Google Analytics.

Install

npm add  @factor/plugin-server-analytics

Settings

// factor-settings.js
export default {
  serverAnalytics: {
    trackingId: "", // GA tracking ID - ua-xxxx-xx
    trackEndpointHits: true, // Send endpoint request events (track each endpoint request)
  },
}

Usage

Tracking endpoint requests

By default this plugin will track endpoint requests with the following:

  • event: 'endpointRequest'
  • action: the id of the endpoint
  • method: the method called

Triggering Custom Server Events

To send a custom event, all that you need to do is send a get/post request to the /__track_event__ endpoint.

The query parameters passed should event, action and/or label.

Example:

import axios from "axios"

axios.get("/__track_event__?event=myEvent&action=theAction&label=theLabel")

A Note On Traffic Filtering

Because server events are triggered from Node, they will show as "non-browser" traffic in analytics (no browser or language set). Keep this in mind when creating filters to screen out bot traffic, etc..

1.8.28

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.24

4 years ago

1.5.21

4 years ago

1.5.12

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.4

4 years ago

1.3.10

4 years ago

1.3.1

4 years ago

1.2.10

4 years ago

1.3.0

4 years ago

1.2.5

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.42

4 years ago

1.1.40

4 years ago

1.1.39

4 years ago

1.1.37

4 years ago