Reference

This page provides reference details that may be helpful when installing, debugging, or using the SWARM Events JS SDK.

CDN

The SWARM Events.js is available via CDN as both standard and minified versions. We recommend loading the minified version when pasting to your site to ensure the best performance.

The Latest Snippet

https://cdn.aiadvertising.com/swarm/events/events.min.js

You can also load a particular Events JS version by referencing that folder in the CDN

https://cdn.aiadvertising.com/swarm/events/1.0.0/events.min.js

Event Types

LabelTypeDescription

Page

PAGE

Records when an individual views a web page

Track

TRACK

Can be used to record any type of action such as "click", "purchase", "download" and more.

Identify

IDENTIFY

Used to identify an individual user by some sort of identifier, example ID, Email, etc.

Group

GROUP

Used to identify an individual as part of a group such as an organization, a persona, etc.

Event Data Schema

All events share a common data schema - depending on the type of event and device that the event was created, some events may not have all values.

Please Note

Some values such as IP_Address are generated on the Server once SWARM receives the event data from the javascript library.

swarm_
{
  "id": "string",
  "type": "string",
  "anonymous_id": "string",
  "user_id": "string",
  "device": {},
  "url": "string",
  "referrer": "string",
  "user_agent": "string",
  "timestamp_sent": "string",
  "timestamp_received": "string",
  "version": "string",
  "data": {},
  "ip_address": {},
  "locale": {},
  "location": {},
  "network": {},
  "os": {},
  "timezone": "string"
}

Snippet Error Codes

CodeError

500

Server Error

402

Rate Limit Exceeded

Events.js Library is tested and supports the following browsers:

  • Apple Safari

  • Google Chrome

  • Mozilla Firefox

  • Microsoft Edge

Internet Explorer Support

While the Events.js should work with Interloop Explorer 11 and later, we make no guarantees that the script will function as expected and do not support installations on Internet Explorer. We recommend that if you are using IE, you should migrate to using Microsoft Edge.

Open Source Libraries

The SWARM Events JS SDK currently uses the following open source libraries. Please see their respective documentation for additional details and source code.

Device-UUID

UUIDV4

Query-String

Unfetch/Polyfill

Last updated