...
The identify
call has the following fields:
FIELD | DETAILS |
| The ID for this user in your database. Note: at least one of |
| An ID associated with the user when you don’t know who they are (for example, the anonymousId generated by |
| A dictionary of traits you know about the user. Things like: |
| A JavaScript date object representing when the identify took place. If the identify just happened, leave it out as journy.io uses the server’s time. If you’re importing data from the past make sure to send a |
| A dictionary of extra context to attach to the call. Note: |
Identifying users happen incremental: You can identify users with a subset of traits
; and later make another identify call with another subset of traits
. The result of both identify calls will be the union of all traits
.
...
The group
call has the following fields:
FIELD | DETAILS |
| The ID for this user in your database. _Note: at least one of |
| An ID associated with the user when you don’t know who they are (eg., the anonymousId generated by |
| The ID of the group. |
| A dict of traits you know about the group. For a company, they might be things like |
| A dict containing any context about the request. |
| A |
Note | ||
---|---|---|
To identify a group, without adding a user, you can use
|
...
The track
call has the following fields:
FIELD | DETAILS |
| The ID for this user in your database. _Note: at least one of |
| An ID associated with the user when you don’t know who they are (for example, the anonymousId generated by |
| The name of the event you’re tracking. We recommend human-readable names like |
| A dictionary of event metadata for the event. If the event was |
| A JavaScript date object representing when the track took place. If the track just happened, leave it out and we’ll use the server’s time. If you’re importing data from the past make sure you to send a |
| A dictionary of extra context to attach to the call. Note: |
Find details on best practices in event naming as well as the track
method payload in the journy.io Spec.
...
The page
method lets you record page views on your website, along with optional extra information about the page being viewed. It is also user to record screen views in your app/on your platform. ⚠️
Note |
---|
Important Note:
|
...
|
...
|
If you’re using our client-side set up in combination with the Node.js library, page calls are already tracked for you by default. However, if you want to record your own page views manually and aren’t using our client-side library, read on!
...
The page
call has the following fields:
FIELD | DETAILS |
| The ID for this user in your database. _Note: at least one of |
| An ID associated with the user when you don’t know who they are (eg., the anonymousId generated by |
| The category of the page. Useful for things like ecommerce where many pages often live under a larger category. |
| The name of the page, for example Signup or Home. Providing a name will determine if |
journy.io will record a screen (with name) or a page (without name). | |
| A dictionary of properties of the page. A few properties specially recognized and automatically translated: |
| A JavaScript date object representing when the track took place. If the track just happened, leave it out and we’ll use the server’s time. If you’re importing data from the past make sure you to send a |
| A dictionary of extra context to attach to the call. Note: |
Find details on the page
payload in the http:// journy.io Spec.
Configuration
The second argument to the Analytics
constructor is an optional list of settings to configure the module.
Code Block |
---|
const analytics = new Analytics({ writeKey: "<YOUR_WRITE_KEY>", host: "https://analyze.journy.io", path: "/backend/v1/batch", maxRetries: 3, maxEventsInBatch: 15, flushInterval: 10000, disable: false }) |
SETTING | DETAILS |
| The key that corresponds to your |
journy.io SDK connector | |
| The base URL of the API. The default is: “https://analyze.journy.io” |
| The API path route. The default is: “backend/v1/batch” |
| The number of times to retry flushing a batch. The default is: |
| The number of messages to enqueue before flushing. The default is: |
| The number of milliseconds to wait before flushing the queue automatically. The default is: |
| The maximum number of milliseconds to wait for an http request. The default is: |
| Disable the analytics library for testing. The default is: |
| A custom HTTP Client implementation to support alternate libraries or proxies. Defaults to global fetch or node-fetch for older versions of node. |
Graceful shutdown
Avoid losing events after shutting down your console. Call .closeAndFlush()
to stop collecting new events and flush all existing events. If a callback on an event call is included, this also waits for all callbacks to be called, and any of their subsequent promises to be resolved.
...
Code Block |
---|
const analytics = new Analytics({
writeKey: "<YOUR_WRITE_KEY>",
host: "https://analyze.journy.io",
path: "/backend/v1/batch"
})
analytics.on("error", (err) => console.error(err)) |