Overview
The Resonate Site tag leverages Analytics.js which is the Resonate JavaScript library that allows customers to capture events across their website and send user-identifying information and page hit information into the Resonate platform as first party data. The Resonate JavaScript Site Tag offers a simplified site tagging experience; clients will only need to create a single tag in the Resonate Platform to get started. Resonate provides the capability for clients to pass key value pairs into Resonate. Data passed in the key value pairs are made available in the Resonate Platform for clients to use to build audiences, analyze, or activate upon.
The Resonate Site Tag API follows the open-source Segment Specification, which can be found online at:
https://segment.com/docs/spec/
Track
The track API method is used for recording any action your users perform. Each action is known as an event and properties can be passed along to help describe the event.
The scenario below captures a triggered event where a user added shoes to their shopping cart, we also know that these shoes fall under the sports category.
analytics.js
analytics.track('Added To Cart', { name: 'Shoes', category: 'Sports', }); |
1 |
event |
String |
required |
The name of the event you're tracking. We recommend that these event names are human-readable. |
|
2 |
properties |
Object (JSON) |
optional |
A dictionary of properties for the event. These properties could include anything that help describe the event. |
|
API
POST https://ds.reson8.com/v1/t |
{ "integrations": {
}, "context": { "page": { "path": "", "referrer": "", "search": "", "title": "", "url": "" }, "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36", "library": { "name": "analytics.js", "version": "2.11.0" } }, "properties": { "name": "Shoes", "category": "Sports" }, "event": "Added To Cart", "anonymousId": "d009a93c-fa13-40ad-b907-703aea9db3d9", "timestamp": "2018-07-02T19:34:54.115Z", "type": "track", "writeKey": "200080210", "userId": null, "sentAt": "2018-07-02T19:34:54.115Z", "_metadata": { "bundled": [ "Segment.io" ], "unbundled": [
] }, "messageId": "ajs-f8seejf8s9f63kp03b42hd88c892ef9q" } |
Identify
The Identify API method is used to tie a user to their actions and record traits about them. It includes the user's unique userId as well as any optional traits you know about them (name, email, etc). You won't need to use the identify method for anonymous visitors to your site, an anonymousId will automatically be assigned.
Our recommendation for when to call the identify method:
- After a user completes registration
- After a user completes log-in
- When a user updates their user information (Contact Information, etc)
- Upon loading any pages that are accessible by a logged in user (optional)
analytics.js
analytics.identify('100928229302220', { name: 'Mary Johnson', email: 'mary.johnson@company.com' }); |
1 |
userId |
String |
optional |
Unique identifier for the user in your database. A userId or anonymousId is required. |
2 |
traits |
Object (JSON) |
optional |
A dictionary of traits for the user. |
API
POST https://ds.reson8.com/v1/i |
{ "integrations": {
}, "context": { "page": { "path": "", "referrer": "", "search": "", "title": "", "url": "" }, "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36", "library": { "name": "analytics.js", "version": "2.11.0" } }, "traits": { "name": "Mary Johnson", "email": "mary.johnson@company.com" }, "userId": "100928229302220", "anonymousId": "d88sa9k0-fbb3-40ad-b0s7-7jf9sl9d88d9", "timestamp": "2018-07-02T19:34:54.119Z", "type": "identify", "writeKey": "200080210", "sentAt": "2018-07-02T19:34:54.119Z", "_metadata": { "bundled": [ "Segment.io" ], "unbundled": [
] }, "messageId": "ajs-js8dtf2cehs7j2ebks98c4999s79b6h2k" } |
Page
The page API method lets you record page views on your website, along with extra optional information about the page being viewed.
The analytics.js library by default calls the page method API without passing any parameters. We do that because it must be called at least once per page load.
We recommend passing a page name in order to see the event in the Resonate platform.
analytics.js
analytics.page('Register'); |
1 |
name |
String |
optional |
The name of the page |
2 |
properties |
Object (JSON) |
optional |
A dictionary of properties for the event. These properties could include anything that help describe the event. |
API
{ "context": { "page": { "path": "", "referrer": "", "search": "", "title": "", "url": "" }, "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36", "library": { "name": "analytics.js", "version": "2.11.0" } }, "integrations": {
}, "properties": { "name": "Register", "path": "", "referrer": "", "search": "", "title": "", "url": "" }, "category": null, "name": "Register", "anonymousId": "d882993c-pp02-8802-6208-ppbc089sbcd9", "timestamp": "2018-07-02T19:28:23.848Z", "type": "page", "writeKey": "200080210", "userId": null, "sentAt": "2018-07-02T19:28:23.848Z", "_metadata": { "bundled": [ "Segment.io" ], "unbundled": [
] }, "messageId": "ajs-c88gdes245687ks9dfj6c30s9dhf11rr" } |
Comments
0 comments
Please sign in to leave a comment.