Skip to Content
Menu

crm()

Sends visitor data to the CRM (default: Hubspot)

JavaScript February 7, 2021

Usage

JavaScript
nebula.crm(action, data, callback)

Parameters

action
(Required) (String) What will be done with the data
Default: None

data
(Required) (Object) The data to store
Default: None

sendNow
(Optional) (Boolean) Send a virtual pageview to work with Hubspot Free CRM
Default: true

Parameter Notes

Action can be “identify” or “event”.

Data is stored as an object of {property: value}.

Request or provide clarification »

Examples

Send multiple columns of data in the same function

JavaScript
nebula.crm('identify', {
    favorite_color: 'green',
    favorite_nfl_team: 'Philadelphia Eagles'
});

Send multiple columns of data in the same function call (using core Hubspot API, for reference). This particular example would be embedded in a PHP script.

JavaScript
_hsq.push(["identify", {
    ipaddress: '<?php echo $_SERVER['REMOTE_ADDR']; ?>',
    user_agent: '<?php echo $_SERVER['HTTP_USER_AGENT']; ?>',
    session_id: '<?php echo nebula()->nebula_session_id(); ?>',
}]);

Additional Notes

This function requires the Hubspot Portal ID in Nebula Options.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    This function was not found in /assets/js/modules/analytics.js. Please report this error.

    No Hooks

    This function does not have any filters or actions available. Request one?

    Override

    To override or disable this JavaScript function, simply redeclare it with the exact same function name. Remember: Some functionality is conditionally loaded via dynamic imports, so if your function is not overriding properly, try listening for a DOM event (described below).

    JavaScript
    function crm(action, data, sendNow){
        //Write your own code here, leave it blank, or return false.
    }