livechatinc

LiveChat - custom variable via button

Oct 29th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.50 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <title>LiveChat custom variables via button</title>
  5.     <meta charset="utf-8">
  6.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1">
  8.     <link rel="stylesheet" type="text/css" href="https://cdn.livechat-static.com/design-system/styles.css">
  9.   </head>  
  10.   <body>
  11.     <h1>Hi there!</h1>
  12.    
  13.     <p>
  14.      This is a test page, add a custom variable by clicking the button below.
  15.     </p>
  16.  
  17.     <script type="text/javascript">
  18.  
  19.       window.__lc = window.__lc || {};
  20.       window.__lc.license = 9720060;
  21.       (function() {
  22.         var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
  23.         lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
  24.         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
  25.       })();
  26.     var custom_variables = [
  27.       { name: "Greeting", value: "True" }
  28.     ];
  29.     </script>
  30.     <noscript>
  31.     <a href="https://www.livechatinc.com/chat-with/9720060/" rel="nofollow">Chat with us</a>,
  32.     powered by <a href="https://www.livechatinc.com/?welcome" rel="noopener nofollow" target="_blank">LiveChat</a>
  33.     </noscript>
  34.     <!-- End of LiveChat code -->
  35.     <button class="lc-btn lc-btn--primary" onclick="LC_API.update_custom_variables(custom_variables);">Click me to add a custom variable</button>
  36.   </body>
  37. </html>
Add Comment
Please, Sign In to add comment