0

i want to fake my location in google analytics by surfing through proxy. i have created the script but the google analytics still show my real location.

The Script i am using is

<?php
$filename = "https://www.example.com";
$proxy = "103.250.147.22:8080";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $filename);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
$data = curl_exec($ch);
curl_close($ch);
echo $data;

?> 

I think the proxy is not working or the code is not working? Can anyone tell me what i am doing wrong?

mohit
  • 290
  • 1
  • 6
  • 19

1 Answers1

0

You can refer to this answer And about Google Analytics its hard to use a fake location

$url = 'http://dynupdate.no-ip.com/ip.php';
$proxy = '127.0.0.1:8888';
//$proxyauth = 'user:password';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);

echo $curl_scraped_page;