Jump to content

Help to insert tracking code on the footer


Recommended Posts

Hello need help to insert the tracking code of intercom (chat support system), the basic track code its working, i insert the code on the footer using "literal" BUT

to track the basic customer data of the customer (when its log in), i need 3 variables that i dont know what to insert or what to put or how to put it, i need the name, email and created_at (creation date i guess is this one), please someone can give me the 3 variables and how to insert them into the code below.

THK

{literal}
<script>
  window.intercomSettings = {
    app_id: "XXXXXXX"
    name: <%= current_user.name %>, // Full name
    email: <%= current_user.email %>, // Email address
    created_at: <%= current_user.created_at.to_i %> // Signup Date
  };
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/uo96gwvw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);[spam-filter]})()</script>
{/literal}

 

Link to comment
Share on other sites

  • 3 weeks later...
On 3/26/2018 at 2:47 PM, borisprado said:

Hello need help to insert the tracking code of intercom (chat support system), the basic track code its working, i insert the code on the footer using "literal" BUT

to track the basic customer data of the customer (when its log in), i need 3 variables that i dont know what to insert or what to put or how to put it, i need the name, email and created_at (creation date i guess is this one), please someone can give me the 3 variables and how to insert them into the code below.

THK


{literal}
<script>
  window.intercomSettings = {
    app_id: "XXXXXXX"
    name: <%= current_user.name %>, // Full name
    email: <%= current_user.email %>, // Email address
    created_at: <%= current_user.created_at.to_i %> // Signup Date
  };
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/uo96gwvw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);[spam-filter]})()</script>
{/literal}

 

 

what is the version of the prestashop where you want to use it ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...