HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: /var/www/javaapp.co.uk/wp-content/plugins/klaviyo/inc/js/kl-identify-browser.js
/**
 * Identify browser on site if they are logged in.
 *
 * Object possibly containing user/commenter email address:
 * @typedef {Object} klUser
 *   @property {string} currect_user_email - Email of logged in user
 *   @property {string} commenter_email - Email of logged in commenter
 *
 */


function klIdentifyBrowser(klUser) {
  var _learnq = window._learnq || [];
  if (klUser.current_user_email) {
    _learnq.push(["identify", {
      "$email": klUser.current_user_email
    }]);
  } else {
    // See if current user is a commenter
    if (klUser.commenter_email) {
      _learnq.push(["identify", {
        "$email": klUser.commenter_email
      }]);
    }
  }
}

window.addEventListener("load", function() {
    klIdentifyBrowser(klUser);
});