Global

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
Source:

Methods

fetchOutreachAccountCustomFields(options) → {Object}

Fetches the specified custom fields from an outreach account
Parameters:
Name Type Description
options Object
Properties
Name Type Description
domain string The domain name of the account
fields Array.<number> The custom field numbers to fetch
Source:
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
Name Type Attributes Description
analyticsProxy Object <optional>
Options for setting up the analytics proxy.
Properties
Name Type Attributes Description
enabled boolean | function Enable the analytics proxy
hostnames Array.<string> <optional>
Additional hostnames to proxy
wordsToMask Array.<string> <optional>
Additional words to mask
segment Object <optional>
Options for seting up segment snippet
Properties
Name Type Attributes Description
enabled boolean | function Enable segment
writeKey string <optional>
The segment api key
load boolean <optional>
Makes the `window.analytics.load()` after executing the snippet. Defaults to false.
sixSense Object <optional>
- Options for setting up 6sense & 6signal snippet
Properties
Name Type Attributes Description
enabled boolean | function Enable 6sense
apiKey string 6sense api key
qa boolean <optional>
Send data to the QA/test endpoint instead of production
companyDetails Object <optional>
Options relating to the 6sense company details API
Properties
Name Type Description
enabled boolean | function Enable the 6sense company details API
apiKey string The company details API api key
callback SixSenseCompanyApiCallback function to run after we receive a response from the 6sense company details API
vwo Object <optional>
Options for setting up the vwo snippet
Properties
Name Type Description
enabled boolean | function Enable vwo
accountId number VWO account ID
redditPixel Object <optional>
Options for setting up the reddit pixel snippet
Properties
Name Type Description
enabled boolean | function Enable the redit pixel
accountId string Reddit adds advertiser id prefixed by
clearbitReveal Object <optional>
Options for setting up Clearbit reveal
Properties
Name Type Description
enabled boolean | function Enable clearbit reveal
apiKey string Public api key for clearbit reveal. starts with pk_
callback function Function to be called with result of clearbit reveal
utmMediumHash Object <optional>
Options for utm_medium URL hash
Properties
Name Type Description
enabled boolean | function Enable putting the utm_medium query param in the hash
logrocket Object <optional>
Options for setting up the logrocket snippet
Properties
Name Type Description
enabled boolean | function Enable LogRocket
callInit boolean Makes the `LogRocket.init()` call once the script has been loaded.
appSlug string LogRocket appslug. Will be passed to `LogRocket.init()` if it is called
initOptions Object Options to pass as-is to `LogRocket.Init()`
mntn Object <optional>
Options for setting up the MNTN snippet
Properties
Name Type Description
enabled boolean | function Enable MNTN
Source:
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
Source:

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
Name Type Description
items Array.<Object> List of DOM nodes whose content we want to swap out.
Properties
Name Type Description
selector string CSS selector for the node
source * The value to set the attribute to. If it is a function, it will be evaluated and the result will be used
attribute string The name of the node attribute to set (e.g. `src` for images and scripts).
addClass Array.<string> List of css classes to add to the node.
removeClass Array.<string> List of css classes to remove from the node.
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
Source:

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`
Source: