Ask Professor Tux: Passing in custom user data in Shopify

Professor TuxingtonThere’s something to be said about customizing Lucky Orange for your unique customers, needs and website. Learn how to pass in custom user data through your Shopify store with Professor Tuxington.

Definition

When visitors come to your website, you want to know who they are and how they are engaging with your products and website.

Out of the box, Lucky Orange provides you basic information for each visitor, such as the visitor’s location and what webpages were visited.

Once you have a relationship with users, you can pass through data customized to fit your customer-base and website needs. Once set up, Custom User Data will appear and be be accessed in many of Lucky Orange’s insights, such as Live Visitors, Recordings and Dynamic Heatmaps. After passing through customer user data, you can see when Sally Smith visited your site so you can connect session recordings, heatmaps and more directly to Sally.

Examples of Customer User Data

  • Email address
  • Username
  • Order information
  • Phone number

Note: If the user email address is added as custom data, Lucky Orange will try to automatically find a Gravatar associated with the email address.

How to set up custom user data in your Shopify Store

  1. Log in to your Shopify site
  2. Click on Online Store
  3. Click on Themes
  4. Click on the Actions icon toward the middle and choose “Edit Code”
  5. Under layout select theme.liquid
  6. Scroll within the page until you find the [/head] tag
  7. Paste the exact code from below just before the [/head] tag
<script>
  var customData = {
    'name' : '{{customer.first_name}} {{customer.last_name}}',
    'email' : '{{customer.email}}',
  }

  window._loq = window._loq || []    
  window._loq.push(['custom', customData])
</script>

Related Link

Leave a Reply

Your email address will not be published. Required fields are marked *