Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdwordsResults (SECTION_TOP) not retrieved when using Proxy #68

Open
sylvestreho opened this issue May 4, 2017 · 1 comment
Open

AdwordsResults (SECTION_TOP) not retrieved when using Proxy #68

sylvestreho opened this issue May 4, 2017 · 1 comment

Comments

@sylvestreho
Copy link

Only natural results are returned when using a proxy (TinyProxy).
AdwordsResults are correctly retrieved without proxy.

I also tried to use this same proxy on my web browser and ad words are correctly displayed on Google.

Is anyone else having the same issue?

Here is my code:

$browser = new Browser(new CurlClient());
$browser->setAcceptLanguage('fr-FR');
$googleClient = new GoogleClient($browser);
$googleUrl = new GoogleUrl('google.fr');
$googleUrl->setSearchTerm("cheap flights");
$proxy = new Proxy('193.xx.xx.xxx', 8888);
$browser->setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A');
$browser->setProxy($proxy);
$response = $googleClient->query($googleUrl, $browser);
$results = $response->getAdwordsResults();
$topResults = $results->getResultsByType(AdwordsResultType::SECTION_TOP);
print_r($topResults);

I get an empty array. Array is filled when this line is commented out:

//$browser->setProxy($proxy);

Please advise.
Best regards,

@gsouf
Copy link
Member

gsouf commented May 4, 2017

Hi @sylvestreho,

I'm not sure if it's an issue with the library or if google decided not to show ad results when you used the proxy, but at this moment I'm not aware of such an issue. I need to try by myself as soon as I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants