HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/scriptjs/demos/analytics.html
<!DOCTYPE HTML>
<html lang="en-us">
  <head>
    <title>advanced $script.js example</title>
    <link rel="stylesheet" href="css/demos.css" type="text/css">
    <script src="../dist/script.js"></script>
  </head>
  <body>

      <h1>Using with Google Analytics</h1>
      <p>As on <a href="http://twitter.com">twitter.com</a>:</p>

      <pre>
          &lt;script type="text/javascript"&gt;
          var _gaq = _gaq || [];
          _gaq.push(['_setAccount', 'UA-XXXXX-X']);
          _gaq.push(
            ['_trackPageview'],
            ['_setDomainName', 'twitter.com']
          );

          (function() {
            var ga = document.createElement('script');
            ga.type = 'text/javascript';
            ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(ga, s);
          }());
          &lt;/script&gt;
      </pre>

      <p>Which can be reduced to:</p>

      <pre>
          &lt;script&gt;
          var _gaq=[['_setAccount','UA-XXXX-X'],['_trackPageview'],['_setDomainName','twitter.com']];
          (function(d,t){
              var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
              g.async=1;
              g.src='//www.google-analytics.com/ga.js';
              s.parentNode.insertBefore(g,s)
          }(document,'script'));
          &lt;/script&gt;
      </pre>

      <p>And with $script.js:</p>

      <pre>
          &lt;script&gt;
          $script("//www.google-analytics.com/ga.js", function(){
              var t = _gat._getTracker ("UA-XXXXX-X");
              t._setDomainName("twitter.com");
              //t._initData();
              t._trackPageview();
          });
          &lt;/script&gt;
      </pre>
      <script>
      // $script("//www.google-analytics.com/ga.js", function(){
      //     var t = _gat._getTracker ("UA-XXXXX-X");
      //     t._setDomainName("twitter.com");
      //     //t._initData();
      //     t._trackPageview();
      // });
      </script>
  </body>
</html>