Skip to content

Activity Extension

The activity extension enables events that track activity on your site. You can also query the extension for the current stats, like click/type counts, max scroll coverage, and more.

Installation

This extension can be enabled through Orbee's Platform. If you are manually controlling installation and setup, you can also fetch the plugin here:

<script async src="https://scripts.orb.ee/js-sdk/latest/activity.js" />

This standalone installation sets up the extension's class on the window object, under window.OaActivityExtension. You can then extend your scope like this:

oa.getScope(YOUR_SCOPE).extend('activity', OaActivityExtension);

Configuration

This extension requires no additional configuration at this time.

This extension has a heartbeat timer between events of 10 seconds. If no activity was done in the heartbeat window, no event is sent.

Methods

This extension has a variety of available attributes and functions to call.

activity.scrollPercent

This provides how much (0-100) the user has scrolled on the current page.

activity.stop()

This allows you to stop sending activity events.

activity.start()

This allows you to startsending activity events. This extension is started by default.

activity.pageTracker.pageviewId

This is the current pageview ID of the page being viewed.

Events

The extension generates the following events:

Page Viewed

oa.track('page viewed', {
    url: "https://the-url.com/",
    title: "Page Title",
    referrer: "https://previous-page.com",
    search: "?a=b",
    path: "/"
});

This event will fire on the following occasions:

  • on extension loading
  • on history.pushState()
  • on history.replaceState()
  • on history.back() or history.forward() or history.go() (via the popstate event)

Activity Tracked

oa.track('activity tracked', {
    // the following are global for the current pageview
    scroll_percent: 100,
    click_count: 3,
    type_count: 45,
    // the following are true/false specifically to the heartbeat window
    scrolled: true,
    clicked: false,
    typed: false,
    mousemoved: true,
});

Listening

This extension does not listen for any events in the SDK.

Dependencies

This extension does not depend on any other extensions.