This guide provides a method to update visitor information using the Olark API if you have an AngularJS app. The method allows you to add a visitor’s name and email to a chat conversation.

In this example, $ is a way to check if the user is logged in to the particular application before setting the Olark values. I also set a local variable called $rootScope.olarkSet to true, so that it will only send once to the Olark JavaScript API.

run(function($rootScope, user, $location, $http) {

    user.init({ appId: 'abc123' });

    $rootScope.$on("$routeChangeStart", function () {

        if ($ && !$rootScope.olarkSet) {
            olark('api.visitor.updateEmailAddress', {emailAddress: $

        olark('api.visitor.updateFullName', {
            fullName: $rootScope.user.first_name + ' ' + $rootScope.user.last_name

        $rootScope.olarkSet = true;