Back to Support

Sending CANDDi ‘properties’ from your database

Published 05 Nov 2020 by Ellice Eadie, CANDDi
Read this in less than 1 minute

When a User has logged into your website, it can be useful to send additional properties from your database through to CANDDi, for example: whether the user is a customer, or their user ID from your database.

You’ll need to trigger a tracking call to CANDDi after the window has loaded. Write the following code into the body of the first page generated after the user has logged in.

NOTE: This assumes you are using jQuery to use $( document ).ready

$( document ).ready(function() {
    if(window.canddi) {
        var objTags = {
            "property1":1,
            "property2":2,
            ...
            [tag] : [score]
            //typically score = 1 but you can use other numbers here
        };  
    window.canddi.sendEvent('#!-1',objTags,false,"TagContact");
    }
});

Once the page has loaded, then the values in ‘property1’ will be transmitted back to CANDDi and stored against the contact.

If you need a hand, just let us know at help@canddi.com