Members
(constant) EMPLOYEE_SIZE_LOOKUP
Employee count-specific customization values
- Source:
Example
window.lr_analytics.EMPLOYEE_SIZE_LOOKUP['50 - 100']
(constant) INDUSTRY_LOOKUP
Industry-specific customization values
- Source:
Example
window.lr_analytics.INDUSTRY_LOOKUP['Test Industry']
(constant) sixSenseCallbacks
Functions to be used with the 6sense company API response
Methods
fetchOutreachAccountCustomFields(options) → {Object}
Fetches the specified custom fields from an outreach account
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
A javascript object with a property for every custom field
that was requested. The properties are named `custom{field_number}`. So if
you requested `fields: [17, 18]`, you would get a object that looks like
this:
```json
{
"custom17": "Whatever custom17 is set to",
"custom18": "Whatever custom18 is set to"
}
```
- Type
- Object
Example
window.lr_analytics.fetchOutreachAccountCustomFields({
domain: 'logrocket.com',
fields: [17, 18],
});
identify(userID, traits)
Send an identify event to segment & LogRocket
Parameters:
| Name | Type | Description |
|---|---|---|
userID |
string | A unique identifier for this user |
traits |
object | A dictionary of traits you know about the user |
- Source:
init(options)
Initializes analytics tools and trackers.
The options object given to this function is a a blueprint for what trackers to enable.
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options object specifying what analytics/trackers to set up.
Properties
|
Example
window.lr_analytics.init({
analyticsProxy : { enabled: true },
segment: {
enabled: true,
writeKey: 'abc',
load: true,
},
sixSense: {
enabled: true,
apiKey: 'xyz',
}
});
mntnConversion()
Record a conversion on the MNTN platform
personalizePage(options)
Personalize the page.
This is done by using the options object as a blueprint for what attributes to set on which DOM nodes.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Object specifying how to personalize the page.
Properties
|
- Source:
Examples
Set a `src` attribute on an `img` tag
window.lr_analytics.personalizePage({
items: [
{
selector: 'img',
attribute: 'src',
source: 'https://example.org/img'
}
]
});
Remove the `hidden` attribute on a DOM node
window.lr_analytics.personalizePage({
items: [
{
selector: 'div',
attribute: 'hidden',
source: false
}
]
});
Add a css class to a DOM node after modifying it
window.lr_analytics.personalizePage({
items: [
{
selector: '#personalize-link',
attribute: 'href',
source: 'https://some-new-link.com',
addClass: ['highlight']
}
]
});
sendSegmentEvents(sixSenseResponse)
Add 6sense information as window properties, then send them to our analytics destinations
This function can be used wherever a SixSenseCompanyApiCallback is required
Parameters:
| Name | Type | Description |
|---|---|---|
sixSenseResponse |
string | The 6sense company API response |
- Source:
Examples
window.lr_analytics.init({
sixSense: {
enabled: true,
apiKey: 'xyz',
companyDetails: {
enabled: true,
apiKey: 'xyz',
callback: window.lr_analytics.sixSenseCallbacks.sendSegmentEvents
}
}
});
window.lr_analytics.init({
sixSense: {
enabled: true,
apiKey: 'xyz',
companyDetails: {
enabled: true,
apiKey: 'xyz',
callback: (response) => {
window.lr_analytics.sixSenseCallbacks.sendSegmentEvents(response);
// do something else with the response
}
}
}
});
track(event, propertiesopt)
Send a track event to segment & LogRocket
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
event |
string | The name of the event | |
properties |
object |
<optional> |
Additional properties |
Type Definitions
SixSenseCompanyApiCallback(sixSenseResponse)
The expected shape of a function that accepts the result of the 6sense company details API call.
Parameters:
| Name | Type | Description |
|---|---|---|
sixSenseResponse |
string | The result of the 6sense company API call. Can be parsed using `JSON.parse` |