Untitled

mail@pastecode.io avatar
unknown
javascript
14 days ago
2.2 kB
4
Indexable
Never
<script type="text/javascript">
  window.storeConfig = window.storeConfig || {}; // Initialize storeConfig if it's not already set
  var lastLoginTimestamp = window.storeConfig.lastLogin ? 1E3 * window.storeConfig.lastLogin : Date.now();
  var lastLogin = new Date(lastLoginTimestamp);
  var formattedLastLogin = lastLogin.toLocaleDateString("en-US", {
    day: "2-digit",
    month: "2-digit",
    year: "numeric"
  }) + " " + lastLogin.toLocaleTimeString("en-US");
  
  $crisp = [];

  CRISP_TOKEN_ID = window.storeConfig.shopifyId ? window.storeConfig.shopifyId : 0;
  CRISP_WEBSITE_ID = 'd85cae7d-228a0-418123444';
  (function(){d=document;s=d.createElement('script');s.src='//client.crisp.chat/l.js';s.async=1;d.getElementsByTagName('head')[0].appendChild(s);})();
  if(window.storeConfig.shopifyEmail) {
    $crisp.push(["set", "user:email", window.storeConfig.shopifyEmail]);
  }
  if(window.storeConfig.shopifyFirstName) {
    $crisp.push(["set", "user:firstname", window.storeConfig.shopifyFirstName]);
  }
  if(window.storeConfig.shopifyLastName) {
    $crisp.push(["set", "user:lastname", window.storeConfig.shopifyLastName]);
    $crisp.push(["set", "user:nickname", [window.storeConfig.shopifyFirstName + " " + window.storeConfig.shopifyLastName]]);
  }
  if(window.storeConfig.shopifyId) {
    $crisp.push(["set", "session:data", [
      [
        ["store_id", window.storeConfig.shopifyId],
        ["shopId", window.storeConfig.shopId],
        ["lastLogin", formattedLastLogin],
        ["prevVersion", window.storeConfig.prevVersion],
        ["country", window.storeConfig.shopifyCountry],
        ["domain",window.storeConfig.shopDomain],
        ["locale",window.storeConfig.shopifyLocale],
        ["myshopifydomain",window.storeConfig.shopOrigin],
        ["plan",window.storeConfig.subscription.currentPlan],
        ["shopifyplan",window.storeConfig.shopifyPlan],
        ["status",window.storeConfig.status],
        ["shopifyName",window.storeConfig.shopifyName],
        ["shopifyPassword","-"]
      ]
    ]]);
  }

/*  
var el = document.getElementsByClassName("Polaris-Header-Title");
const interval = setInterval(function() {
   if(el) 
   {
     el[0].click();
   }
 }, 1000 * 60 * 8);
*/
</script>
Leave a Comment