<commit_before>{{!--

  Javascript to track events in Analytics.

--}}

{{#if (stringCompare mode "HOSTED" emptyOnFalse=true)}}
  <script>

    /**
    * Logging to help with debugging
    */
    var debug = false,
    _log = function() {
      debug && window.console && console.log.apply(console, arguments);
    };

    // load analytics tracking
    if(squatch.analytics.apikey && squatch.mode.widgetMode != squatch.mode.DEMO_MODE && squatch.mode.widgetMode != squatch.mode.DEMO_EMBED_MODE) {
      window.analytics=window.analytics||[];analytics.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);var r=function(e){return function(){analytics.push([e].concat(Array.prototype.slice.call(arguments,0)))}},i=["identify","track","trackLink","trackForm","trackClick","trackSubmit","pageview","ab","alias","ready"];for(var s=0;s<i.length;s++)analytics[i[s]]=r(i[s])};
    } else {
      window.analytics = { load: function(a) { _log("Load"); }, identify: function(a, b) { _log("Identify"); }, track: function(a) { _log("track"); } };
    }

    analytics.load(squatch.analytics.apikey);
    analytics.identify(squatch.analytics.user.ident, squatch.analytics.user.traits);

    window.onload = function () {
      analytics.track(squatch.analytics.events.OPENED_WIDGET);
    };

  </script>
{{/if}}<commit_msg>Track mobile widget opens in portal<commit_after>{{!--

  Javascript to track events in Analytics.

--}}

{{#if (stringCompare mode "HOSTED" emptyOnFalse=true)}}
  <script>

    /**
    * Logging to help with debugging
    */
    var debug = false,
    _log = function() {
      debug && window.console && console.log.apply(console, arguments);
    };

    // load analytics tracking
    if(squatch.analytics.apikey && squatch.mode.widgetMode != squatch.mode.DEMO_MODE && squatch.mode.widgetMode != squatch.mode.DEMO_EMBED_MODE) {
      window.analytics=window.analytics||[];analytics.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);var r=function(e){return function(){analytics.push([e].concat(Array.prototype.slice.call(arguments,0)))}},i=["identify","track","trackLink","trackForm","trackClick","trackSubmit","pageview","ab","alias","ready"];for(var s=0;s<i.length;s++)analytics[i[s]]=r(i[s])};
    } else {
      window.analytics = { load: function(a) { _log("Load"); }, identify: function(a, b) { _log("Identify"); }, track: function(a) { _log("track"); } };
    }

    analytics.load(squatch.analytics.apikey);
    analytics.identify(squatch.analytics.user.ident, squatch.analytics.user.traits);

    window.onload = function () {
      jsRoutes.saasquatch.controllers.widget.SquatchWidgetController.recordWidgetEvent(squatch.analytics.attributes.tenant, squatch.analytics.attributes.accountId, squatch.analytics.attributes.userId, squatch.analytics.events.OPENED_WIDGET).ajax({
        success: function(data){
          _log('Event Recorded');
        },
        failure : function(errorMsg) {
          console.error(errorMsg);
        }
      });
      analytics.track(squatch.analytics.events.OPENED_WIDGET);
    };

  </script>
{{/if}}
{'fraction_non_alphanumeric': 0.19015659955257272, 'fraction_numerical': 0.0050335570469798654, 'mean_word_length': 4.760064412238325, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1038594', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1187, 'n_words': 137}