Ingestly Client JavaScript SDK for modern web analytics.
Japanese Document available here / 日本語ドキュメントはこちら
Ingestly is a simple tool for ingesting beacons to Google BigQuery. Digital Marketers and Front-end Developers often want to measure user’s activities on their service without limitations and/or sampling, in real-time, having ownership of data, within reasonable cost. There are huge variety of web analytics tools in the market but those tools are expensive, large footprint, less flexibility, fixed UI, and you will be forced to use SDKs including legacy technologies like document.write
.
Ingestly is focusing on Data Ingestion from the front-end to Google BigQuery by leveraging Fastly’s features.
Also, Ingestly can be implemented seamlessly into your existing web site with in the same Fastly service, so you can own your analytics solution and ITP does not matter.
Ingestly provides:
If you want to use the pre-build SDK, you can use files piblished in GitHub Releases.
If you wish to build the SDK by yourself, node.js is required.
ingestlyId
, ingestlySes
and ingestlyConsent
under your specified domain name.
# Install required node_modules (only for build process. no dependencies.)
npm install
# ESLINT under ./src
npm run lint
# Build the SDK into ./dist
npm run build
./dist/page_code.js
endpoint
: a hostname of Ingestly Endpoint you provisioned.apiKey
: an API key for the endpoint. This value must be listed as true
in Fastly’s Custom VCL for Ingestly.eventName
: the SDK dispatches a recurring event based on a timing of requestAnimationFrame. You can specify a name of this event.eventFrequency
: the recurring event is throttled by this interval in millisecond. Set a small number if you want to make the SDK sensitive.targetWindow
: a property name of target window. you can use self
, parent
or top
. useCookie
: a default mode of device identification by Cookie. Set true
to enable, set false
to disable.Note: If you remove eventName
and/or eventFrequency
, or set 0
for eventFrequency
, the recurring event will be disabled.
ingestly.js
and a config file page_code.js
to your web site.<script>
tags into all pages like the below to fire Ingestly Tracking method.
<script src="./dist/ingestly.js"></script>
<script src="./dist/page_code.js"></script>
You can enable optional tracking features.
config()
, set true
for options.rum.enable
.config()
, set true
for options.unload.enable
.data-*
attribution. options.clicks.targetAttr
but options.clicks.enable
is true
, Click tracking will measure clicks on elements without data-*
attribution. config()
, set true
for options.clicks.enable
and adjust values:variable | example | description |
---|---|---|
targetAttr | data-trackable |
attribution name for identifying the target element |
data-trackable
for targetAttr
, you need to add data-trackable
attribution to every element you want to track clicks.data-trackable
with meaningful value.config()
, set true
for options.scroll.enable
and adjust values:variable | example | description |
---|---|---|
threshold | 2 |
track the depth when the user stay at/over X percent/pixels for more than T seconds specified here |
granularity | 20 |
track the depth every X percent/pixels increased |
unit | percent |
for the fixed height page, you can use percent . If the page is infinity scroll, use pixels instead |
config()
, set true
for options.read.enable
and adjust values:variable | example | description |
---|---|---|
threshold | 4 |
track the depth of content when the user stay at/over X percent |
granularity | 10 |
track the rate every X percent increased |
targets | document.getElementsByTagName('article') |
An array of elements. (nodeList or array) specify block elements to observed as a target of read-through. |
play
, pause
and eneded
events plus the heart-beat.config()
, set true
for options.media.enable
and adjust values:variable | example | description |
---|---|---|
heartbeat | 5 |
the heart-beat tracker will be dispatched every X sec defined here |
config()
, set true
for options.form.enable
and adjust values:variable | example | description |
---|---|---|
targets | document.getElementsByTagName('form') |
A list of form elements. |
Ingestly
.ingestlyRecurringEvent
(or your specified name in config()
) can be used for observing elements repeatedly.dataModel
must be an object. You can add custom variables if you define BigQuery’s schema and Log Format for Fastly.Init()
.cookie
as Boolean type, you can control the SDK to use Cookie or not per a browser.false
to measurement
, the SDK will not send beacons.key | description |
---|---|
cookie | reserved for Cookie control. |
measurement | reserved to enable/disable data transmission. |
analytics | |
personalization | |
advertisement | |
sharing |
''
.init()
, and the method just returns the value from the object. So, if your SPA updates URL parameter, and you want to use it for measurement, you need to call init()
or do not use this method.