Hello!
I am running a script via which I am getting some info from another site. But I do not want the IP of the server which runs that script to be got by the Google-Analytics javascript, which is located on the page I am getting the info from. Do you know how can I stop the execution of the Google analytics script from the page I am getting the info with PHP? I know one sure method, which is to put in the /etc/hosts file on the server the line

127.0.0.1 google-analytics.com

That line makes the line which must load the GA javascript to ping the local server, instead of loading the script. The problem is that the support of the hosting I am using denied to do that for me. So, do you know another way for doing that in PHP?

    if you get the file via file() or file-get_contents() the js that Google-Analytics uses, wont run (unless you send the retried file directly to a browser).

      I am getting the file via

          function get($url, $ref='') {
              $process = curl_init($url);
              curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers);
              curl_setopt($process, CURLOPT_HEADER, 0);
              curl_setopt($process, CURLOPT_REFERER, $ref);
              curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent);
              if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file);
              if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file);
              curl_setopt($process,CURLOPT_ENCODING , $this->compression);
              curl_setopt($process, CURLOPT_TIMEOUT, 30);
              //if ($this->proxy) curl_setopt($cUrl, CURLOPT_PROXY, ‘proxy_ip:proxy_port’);
              curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
              curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
              $return = curl_exec($process);
              curl_close($process);
              return $return;
          }

      What do you think about that?

        strip the google code before outputting it, i assume you have permission from the site owner to do this?

          Write a Reply...