Adding customer identification for Shopify logged in users

Add the following code to all your Layout files (ex. Theme.liquid) before the yappy.im javascript generally located right before the closing </body> tag.

{%if customer %}
<script type="text/javascript">
 window.yappyChatWidgetMeta = [];
 window.yappyChatWidgetMeta.push({'email':'{{ customer.email }}'});
 window.yappyChatWidgetMeta.push({'name':'{{ customer.name }}'});
 window.yappyChatWidgetMeta.push({'phone':'{{ customer.phone }}'});
</script>
{%endif%}
 

 

 

 

Leave A Comment?