Re: Authentication error with New Google.Ads.Common.dll , Google.AdWords.dll version V201306

2013-08-20 Thread Anash P. Oommen (AdWords API Team)
Hi Pramod,

Could you try the code in a slightly different manner? The C# code 
equivalent is as follows:

AdWordsUser user = new AdWordsUser();
AdWordsAppConfig config = (AdWordsAppConfig) user.Config;

config.DeveloperToken = "";
//...more settings

CampaignService campaignService = (CampaignService) 
user.GetService(AdWordsService.v201306.CampaignService);

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Tuesday, August 20, 2013 10:50:33 AM UTC+5:30, Pramod Patil wrote:
>
> Hi,
>  
> Yes, I am able login to AdWords Web Interface with the pair email and 
> password.
>  
> Please suggest me what's going wrong in my code with latest API DLL 
> version v201306 
>  
> Thanks!!!
>
> On Monday, August 19, 2013 2:51:56 PM UTC+5:30, Takeshi Hagikura (AdWords 
> API Team) wrote:
>
>> Hi,  
>>
>> Can you login to AdWords web interface with the pair of email and 
>> password?
>>
>> Best,
>> - Takeshi, AdWords API Team
>>
>> On Friday, August 16, 2013 8:47:33 PM UTC+9, Pramod Patil wrote: 
>>>
>>>  Hi,
>>>  
>>> I am using Google.Ads.Common.dll , Google.AdWords.dll with File Version 
>>> 1.8.0.0. Would you please help How to work with version v201306 and 
>>> existing code.
>>>  
>>> Please have a look on below code and see red code for which I am gettign 
>>> error.
>>>  
>>> App.config has below seetings
>>>  
>>> 
>>> 
>>>   
>>> 
>>>   
>>> 
>>>   
>>>  
>>>  
>>> Imports Google.Api.Ads.AdWords.Lib
>>> Imports Google.Api.Ads.AdWords.v201306
>>> Public Function getUser() As AdWordsUser
>>> Dim headers As New Dictionary(Of String, String)
>>> headers.Add("email", "XXX...@.X")
>>> headers.Add("password", "XX")
>>> headers.Add("useragent", X")
>>> headers.Add("developerToken", "X")
>>> headers.Add("applicationToken", "")   
>>> headers.Add("clientCustomerId", "XXX")
>>> Dim AdWordsUserObj As New AdWordsUser(headers)
>>>   
>>> End Function
>>>  
>>>  
>>> Public Function updateCampaigns() As Integer
>>> Dim user As AdWordsUser
>>> user = getUser()
>>>
>>> user.Config.RetryCount = 3
>>>
>>> If user Is Nothing Then
>>> Return 0
>>> End If
>>>
>>> Dim CampaignServiceObj As CampaignService
>>> Dim page As CampaignPage   
>>>CampaignServiceObj = 
>>> user.GetService(AdWordsService.v201306.CampaignService)
>>>
>>> Try
>>> Dim selector As New Selector()
>>> selector.fields = New String() {"Id", "Name", "Status", 
>>> "Impressions", "Cost", "Ctr", "AveragePosition", "Conversions", "Clicks"} 
>>> ', "ConversionRate"}
>>>
>>> Dim orderByName As New OrderBy()
>>> orderByName.field = "Name"
>>> orderByName.sortOrder = SortOrder.ASCENDING
>>>
>>>Dim SearchEngineDBObj As New SearchEngineDB(SQLConn)
>>> Dim SearchEngineObj As SearchEngine
>>>
>>> selector.ordering = New OrderBy() {orderByName}
>>> TryCast(user.Config, AdWordsAppConfig).ClientCustomerId 
>>> = ""
>>>
>>> selector.paging = New Paging()
>>> selector.paging.startIndex = 0
>>> selector.paging.numberResults = 500
>>>
>>> page = CampaignServiceObj.get(selector) 'getting error 
>>> for Authentication.
>>>   
>>>
>>> Catch ex As Exception
>>> Return 0
>>> End Try
>>>
>>> If page Is Nothing Then
>>> Return 0
>>> End If
>>>
>>> Try
>>> If page.entries.Length = 0 Then
>>> Return 0
>>> End If
>>> Catch ex As Exception
>>> Return 0
>>> End Try
>>>
>>>
>>> For Each CampaignObj As 
>>> Google.Api.Ads.AdWords.v201306.Campaign In page.entries
>>> 
>>> Next
>>>
>>> Return page.entries.Length - 1
>>> End Function
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.c

Re: OAuth2 still asking for email & password values

2013-08-20 Thread Takeshi Hagikura (AdWords API Team)
Hi Alan, 

What script are you running when you see a validation error?
Please see this 
guide on 
OAuth2 introduction with PHP. 
If you have further questions, please let us know.

Best,
- Takeshi, AdWords API Team

On Monday, August 19, 2013 2:50:20 AM UTC+9, Alan Coleman wrote:
>
> Hello everyone,
>
> I'm moving my AdWords app from Client Login to OAuth2 authentication in 
> preparation to migrate to v201306.
>
> I've read the documentation and understand the concept of OAuth2 and have 
> experimented successfully with a little Google+ login script.
>
> I'm confused about how my app will use OAuth2 instead of Client Login. 
>
> In *auth.ini* I've replaced the* Client Login'*s *email* and *password*with 
> *OAuth2*'s *client_id* and *client_secret* from the api console but I 
> immediately receive a validation error asking for email and password values.
>
> I was under the impression that the existence of client_id and 
> client_secret would prompt the use of OAuth2 ?
>
> As always any pointers would be greatly appreciated.
>
> I'm using library: adwords_api_php_4.2.5 version: v201302
>
> Many thanks
>
>
>
>
>
>  
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issue migrating from v201209 to v201306

2013-08-20 Thread Alan Coleman
Hi Tommy,

I tried to migrate from v201302 to v201306 using Client Login and received 
an error that informed me that Client Login is no longer supported.

Thanks

On Monday, July 29, 2013 4:03:06 PM UTC+1, Tommy Newman wrote:
>
> Thanks Anash, I have put a couple of issues there, but perhaps you can 
> help me. I am a bit unclear whether I *must* use OAuth2 with v201306, or 
> whether I can still use email, password and developer token at present? 
> (even if deprecated). Or, is authToken a different / easier step?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: OAuth2 still asking for email & password values

2013-08-20 Thread Alan Coleman
Hi Takeshi,

Thanks for your reply. I'm running a script that verifies an AdWords Ad 
against the API before storing it locally, simple stuff and it works with 
my current Client Login set up.

I've been through all the OAuth2 documentation and it all makes sense. I've 
created the application identifier and added my client_id and client_secret 
pair to my auth.ini and removed email and password associated with Client 
Login. Is this all I need to do to implement OAuth2 ? If so, I don't 
understand why I'm still be ing asked for the email and password pair.

Also, I am correct in thinking that Client Login has been deprecated in 
v201306?

Many thanks

On Tuesday, August 20, 2013 10:12:19 AM UTC+1, Takeshi Hagikura (AdWords 
API Team) wrote:
>
> Hi Alan, 
>
> What script are you running when you see a validation error?
> Please see this 
> guide on 
> OAuth2 introduction with PHP. 
> If you have further questions, please let us know.
>
> Best,
> - Takeshi, AdWords API Team
>
> On Monday, August 19, 2013 2:50:20 AM UTC+9, Alan Coleman wrote:
>>
>> Hello everyone,
>>
>> I'm moving my AdWords app from Client Login to OAuth2 authentication in 
>> preparation to migrate to v201306.
>>
>> I've read the documentation and understand the concept of OAuth2 and have 
>> experimented successfully with a little Google+ login script.
>>
>> I'm confused about how my app will use OAuth2 instead of Client Login. 
>>
>> In *auth.ini* I've replaced the* Client Login'*s *email* and *password*with 
>> *OAuth2*'s *client_id* and *client_secret* from the api console but I 
>> immediately receive a validation error asking for email and password values.
>>
>> I was under the impression that the existence of client_id and 
>> client_secret would prompt the use of OAuth2 ?
>>
>> As always any pointers would be greatly appreciated.
>>
>> I'm using library: adwords_api_php_4.2.5 version: v201302
>>
>> Many thanks
>>
>>
>>
>>
>>
>>  
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: OAuth2 still asking for email & password values

2013-08-20 Thread Takeshi Hagikura (AdWords API Team)
As in this guide, 
I recommend to store refresh_token in your auth.ini.
Once you store refresh_token, you'll not be asked for email and password 
pair.

Please see the "Running OAuth2.0 example" section and run this 
GetRefreshToken.php
 as 
in the guide.

When you paste the authentication URL and if you haven't logged in with the 
account, being asked email and password is the normal behavior. 
After you login, you can grant access like in the 
screenshot
.

After you get refresh_token, update your auth.ini, then it's all set. 
Please run any other examples such as 
GetCampaigns
.

> Also, I am correct in thinking that Client Login has been deprecated in 
v201306?
Right. Actually it has been 
deprecated 
more 
than a year ago.

Best,
- Takeshi, AdWords API Team

On Tuesday, August 20, 2013 6:44:44 PM UTC+9, Alan Coleman wrote:
>
> Hi Takeshi,
>
> Thanks for your reply. I'm running a script that verifies an AdWords Ad 
> against the API before storing it locally, simple stuff and it works with 
> my current Client Login set up.
>
> I've been through all the OAuth2 documentation and it all makes sense. 
> I've created the application identifier and added my client_id and 
> client_secret pair to my auth.ini and removed email and password associated 
> with Client Login. Is this all I need to do to implement OAuth2 ? If so, I 
> don't understand why I'm still be ing asked for the email and password pair.
>
> Also, I am correct in thinking that Client Login has been deprecated in 
> v201306?
>
> Many thanks
>
> On Tuesday, August 20, 2013 10:12:19 AM UTC+1, Takeshi Hagikura (AdWords 
> API Team) wrote:
>>
>> Hi Alan, 
>>
>> What script are you running when you see a validation error?
>> Please see this 
>> guide on 
>> OAuth2 introduction with PHP. 
>> If you have further questions, please let us know.
>>
>> Best,
>> - Takeshi, AdWords API Team
>>
>> On Monday, August 19, 2013 2:50:20 AM UTC+9, Alan Coleman wrote:
>>>
>>> Hello everyone,
>>>
>>> I'm moving my AdWords app from Client Login to OAuth2 authentication in 
>>> preparation to migrate to v201306.
>>>
>>> I've read the documentation and understand the concept of OAuth2 and 
>>> have experimented successfully with a little Google+ login script.
>>>
>>> I'm confused about how my app will use OAuth2 instead of Client Login. 
>>>
>>> In *auth.ini* I've replaced the* Client Login'*s *email* and *password*with 
>>> *OAuth2*'s *client_id* and *client_secret* from the api console but I 
>>> immediately receive a validation error asking for email and password values.
>>>
>>> I was under the impression that the existence of client_id and 
>>> client_secret would prompt the use of OAuth2 ?
>>>
>>> As always any pointers would be greatly appreciated.
>>>
>>> I'm using library: adwords_api_php_4.2.5 version: v201302
>>>
>>> Many thanks
>>>
>>>
>>>
>>>
>>>
>>>  
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: An error has occurred: { "error" : "invalid_grant" }

2013-08-20 Thread Jur
Hello Takeshi,

Clientid: 
535034169318-5vb9ld76jrt5htp9860ps5k6kjqua6c6.apps.googleusercontent.com
Client_secreat:fEQ5CL5xL9s-joJI990A-8C4 

I use the standard getCampainsExample function:

// Include the AdWordsUser
require_once LIB_PATH . '/AdWordsUser.php';

function GetCampaignsExample(AdWordsUser $user) {
  // Get the service, which loads the required classes.
  $campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);

  // Create selector.
  $selector = new Selector();
  $selector->fields = array('Id', 'Name');
  $selector->ordering[] = new OrderBy('Name', 'ASCENDING');

  // Create paging controls.
  $selector->paging = new Paging(0, 
AdWordsConstants::RECOMMENDED_PAGE_SIZE);

  do {
// Make the get request.
$page = $campaignService->get($selector);

// Display results.
if (isset($page->entries)) {
  foreach ($page->entries as $campaign) {
printf("Campaign with name '%s' and ID '%s' was found.\n",
$campaign->name, $campaign->id);
  }
} else {
  print "No campaigns were found.\n";
}

// Advance the paging index.
$selector->paging->startIndex += 
AdWordsConstants::RECOMMENDED_PAGE_SIZE;
  } while ($page->totalNumEntries > $selector->paging->startIndex);
}

try {
  // Get AdWordsUser from credentials in "../auth.ini"
  // relative to the AdWordsUser.php file's directory.
  $user = new AdWordsUser();
  // Log every SOAP XML request and response.
  $user->LogAll();
  
  // Run the example.
  GetCampaignsExample($user);
} catch (Exception $e) {
print_r($e);
  printf("An error has occurred: %s\n", $e->getMessage());
}


Op maandag 19 augustus 2013 10:30:24 UTC+2 schreef Takeshi Hagikura 
(AdWords API Team):
>
> Hi Jur, 
>
> What clientId and clientSecret are you passing to the script when you run 
> the GetRefreshToken.php script?
> And can you please share the request xml when you run the GetCampaign 
> (except for the sensitive info)? 
>
> Best,
> - Takeshi, AdWords API Team
>
>
> On Friday, August 9, 2013 1:15:48 AM UTC+9, Jur wrote:
>>
>> Hello Guys,
>>  
>> I'm working on my first Google Adwords API application, but I can't get 
>> passed the oauth2 verification.
>> I could get a refresh_token with the GetRefreshToken.php script, but I 
>> get the error : An error has occurred: { "error" : "invalid_grant" } when I 
>> request a list of campaines in my test account.
>>  
>> Hope someone can help me out in the right direction.
>>  
>> Regards,
>>  
>> Jur
>>  
>> MMC id : 916-243-9387
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: OAuth2 still asking for email & password values

2013-08-20 Thread Alan Coleman
Thanks Takeshi, your help is always appreciated.

I was confused about the refresh_token procedure.

Just one more question  if I may, how long will the refresh_token last for?

Many thanks. 

On Tuesday, August 20, 2013 12:04:36 PM UTC+1, Takeshi Hagikura (AdWords 
API Team) wrote:
>
> As in this 
> guide, 
> I recommend to store refresh_token in your auth.ini.
> Once you store refresh_token, you'll not be asked for email and password 
> pair.
>
> Please see the "Running OAuth2.0 example" section and run this 
> GetRefreshToken.php
>  as 
> in the guide.
>
> When you paste the authentication URL and if you haven't logged in with 
> the account, being asked email and password is the normal behavior. 
> After you login, you can grant access like in the 
> screenshot
> .
>
> After you get refresh_token, update your auth.ini, then it's all set. 
> Please run any other examples such as 
> GetCampaigns
> .
>
> > Also, I am correct in thinking that Client Login has been deprecated in 
> v201306?
> Right. Actually it has been 
> deprecated 
> more 
> than a year ago.
>
> Best,
> - Takeshi, AdWords API Team
>
> On Tuesday, August 20, 2013 6:44:44 PM UTC+9, Alan Coleman wrote:
>>
>> Hi Takeshi,
>>
>> Thanks for your reply. I'm running a script that verifies an AdWords Ad 
>> against the API before storing it locally, simple stuff and it works with 
>> my current Client Login set up.
>>
>> I've been through all the OAuth2 documentation and it all makes sense. 
>> I've created the application identifier and added my client_id and 
>> client_secret pair to my auth.ini and removed email and password associated 
>> with Client Login. Is this all I need to do to implement OAuth2 ? If so, I 
>> don't understand why I'm still be ing asked for the email and password pair.
>>
>> Also, I am correct in thinking that Client Login has been deprecated in 
>> v201306?
>>
>> Many thanks
>>
>> On Tuesday, August 20, 2013 10:12:19 AM UTC+1, Takeshi Hagikura (AdWords 
>> API Team) wrote:
>>>
>>> Hi Alan, 
>>>
>>> What script are you running when you see a validation error?
>>> Please see this 
>>> guide on 
>>> OAuth2 introduction with PHP. 
>>> If you have further questions, please let us know.
>>>
>>> Best,
>>> - Takeshi, AdWords API Team
>>>
>>> On Monday, August 19, 2013 2:50:20 AM UTC+9, Alan Coleman wrote:

 Hello everyone,

 I'm moving my AdWords app from Client Login to OAuth2 authentication in 
 preparation to migrate to v201306.

 I've read the documentation and understand the concept of OAuth2 and 
 have experimented successfully with a little Google+ login script.

 I'm confused about how my app will use OAuth2 instead of Client Login. 

 In *auth.ini* I've replaced the* Client Login'*s *email* and 
 *password*with 
 *OAuth2*'s *client_id* and *client_secret* from the api console but I 
 immediately receive a validation error asking for email and password 
 values.

 I was under the impression that the existence of client_id and 
 client_secret would prompt the use of OAuth2 ?

 As always any pointers would be greatly appreciated.

 I'm using library: adwords_api_php_4.2.5 version: v201302

 Many thanks





  

>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: OAuth2 still asking for email & password values

2013-08-20 Thread Takeshi Hagikura (AdWords API Team)
Hi Alan,

> Just one more question  if I may, how long will the refresh_token last 
for?
refresh_token never expires unless you explicitly revoke the API access. 

Best,
- Takeshi, 

On Tuesday, August 20, 2013 9:00:52 PM UTC+9, Alan Coleman wrote:
>
> Thanks Takeshi, your help is always appreciated.
>
> I was confused about the refresh_token procedure.
>
> Just one more question  if I may, how long will the refresh_token last for?
>
> Many thanks. 
>
> On Tuesday, August 20, 2013 12:04:36 PM UTC+1, Takeshi Hagikura (AdWords 
> API Team) wrote:
>>
>> As in this 
>> guide, 
>> I recommend to store refresh_token in your auth.ini.
>> Once you store refresh_token, you'll not be asked for email and password 
>> pair.
>>
>> Please see the "Running OAuth2.0 example" section and run this 
>> GetRefreshToken.php
>>  as 
>> in the guide.
>>
>> When you paste the authentication URL and if you haven't logged in with 
>> the account, being asked email and password is the normal behavior. 
>> After you login, you can grant access like in the 
>> screenshot
>> .
>>
>> After you get refresh_token, update your auth.ini, then it's all set. 
>> Please run any other examples such as 
>> GetCampaigns
>> .
>>
>> > Also, I am correct in thinking that Client Login has been deprecated in 
>> v201306?
>> Right. Actually it has been 
>> deprecated 
>> more 
>> than a year ago.
>>
>> Best,
>> - Takeshi, AdWords API Team
>>
>> On Tuesday, August 20, 2013 6:44:44 PM UTC+9, Alan Coleman wrote:
>>>
>>> Hi Takeshi,
>>>
>>> Thanks for your reply. I'm running a script that verifies an AdWords Ad 
>>> against the API before storing it locally, simple stuff and it works with 
>>> my current Client Login set up.
>>>
>>> I've been through all the OAuth2 documentation and it all makes sense. 
>>> I've created the application identifier and added my client_id and 
>>> client_secret pair to my auth.ini and removed email and password associated 
>>> with Client Login. Is this all I need to do to implement OAuth2 ? If so, I 
>>> don't understand why I'm still be ing asked for the email and password pair.
>>>
>>> Also, I am correct in thinking that Client Login has been deprecated in 
>>> v201306?
>>>
>>> Many thanks
>>>
>>> On Tuesday, August 20, 2013 10:12:19 AM UTC+1, Takeshi Hagikura (AdWords 
>>> API Team) wrote:

 Hi Alan, 

 What script are you running when you see a validation error?
 Please see this 
 guide on 
 OAuth2 introduction with PHP. 
 If you have further questions, please let us know.

 Best,
 - Takeshi, AdWords API Team

 On Monday, August 19, 2013 2:50:20 AM UTC+9, Alan Coleman wrote:
>
> Hello everyone,
>
> I'm moving my AdWords app from Client Login to OAuth2 authentication 
> in preparation to migrate to v201306.
>
> I've read the documentation and understand the concept of OAuth2 and 
> have experimented successfully with a little Google+ login script.
>
> I'm confused about how my app will use OAuth2 instead of Client Login. 
>
> In *auth.ini* I've replaced the* Client Login'*s *email* and *password
> * with *OAuth2*'s *client_id* and *client_secret* from the api 
> console but I immediately receive a validation error asking for email and 
> password values.
>
> I was under the impression that the existence of client_id and 
> client_secret would prompt the use of OAuth2 ?
>
> As always any pointers would be greatly appreciated.
>
> I'm using library: adwords_api_php_4.2.5 version: v201302
>
> Many thanks
>
>
>
>
>
>  
>


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://

Re: Adwords API limits

2013-08-20 Thread Jeremy Aube
You should add code that handles any RateExceededError that you get. 
Generally the error will include information about how long you should back 
off for (usually 30 seconds). It may take a full minute though before you 
can make a successful request, however, so you should be prepared to catch 
the error at least twice in a row.

On Monday, August 19, 2013 7:29:01 AM UTC-4, Omri Cohen wrote:
>
> Thanks Jason!
> Are you suggesting trial and error as the best practice to learn about my 
> limits?
>
> On Monday, August 19, 2013 2:11:54 PM UTC +3, Jason Stedman wrote:
>>
>> Omri, 
>>
>> The System Limits documentation is located here:
>>
>> https://developers.google.com/ adwords / api / docs / appendix / 
>> Limits
>>
>> You will not see any kind of rate limits there as the AdWords API rate 
>> limits are dynamic. It is expected that all clients properly back off if 
>> the current rate limit is exceeded. A RateExceededError is thrown if a 
>> client exceeds the rate limit.
>>
>> Hope this answers your question.
>>
>> Jason
>>
>>
>>
> This e-mail, as well as any attached document, may contain material which 
> is confidential and privileged and may include trademark, copyright and 
> other intellectual property rights that are proprietary to Kenshoo Ltd, its 
> subsidiaries or affiliates ("Kenshoo"). This e-mail and its attachments 
> may be read, copied and used only by the addressee for the purpose (s) for 
> which it was disclosed herein. If you have received it in error, please 
> destroy the message and any attachment, and contact us immediately. If 
> you are not the intended recipient, be aware that any review, reliance, 
> disclosure, copying, distribution or use of the contents of this message 
> without Kenshoo's express permission is strictly prohibited.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: OAuth2 still asking for email & password values

2013-08-20 Thread Alan Coleman
As always, thanks very much for taking the time to help.

Cheers!

On Tuesday, August 20, 2013 3:26:13 PM UTC+1, Takeshi Hagikura (AdWords API 
Team) wrote:
>
> Hi Alan,
>
> > Just one more question  if I may, how long will the refresh_token last 
> for?
> refresh_token never expires unless you explicitly revoke the API access. 
>
> Best,
> - Takeshi, 
>
> On Tuesday, August 20, 2013 9:00:52 PM UTC+9, Alan Coleman wrote:
>>
>> Thanks Takeshi, your help is always appreciated.
>>
>> I was confused about the refresh_token procedure.
>>
>> Just one more question  if I may, how long will the refresh_token last 
>> for?
>>
>> Many thanks. 
>>
>> On Tuesday, August 20, 2013 12:04:36 PM UTC+1, Takeshi Hagikura (AdWords 
>> API Team) wrote:
>>>
>>> As in this 
>>> guide, 
>>> I recommend to store refresh_token in your auth.ini.
>>> Once you store refresh_token, you'll not be asked for email and password 
>>> pair.
>>>
>>> Please see the "Running OAuth2.0 example" section and run this 
>>> GetRefreshToken.php
>>>  as 
>>> in the guide.
>>>
>>> When you paste the authentication URL and if you haven't logged in with 
>>> the account, being asked email and password is the normal behavior. 
>>> After you login, you can grant access like in the 
>>> screenshot
>>> .
>>>
>>> After you get refresh_token, update your auth.ini, then it's all set. 
>>> Please run any other examples such as 
>>> GetCampaigns
>>> .
>>>
>>> > Also, I am correct in thinking that Client Login has been deprecated 
>>> in v201306?
>>> Right. Actually it has been 
>>> deprecated
>>>  more 
>>> than a year ago.
>>>
>>> Best,
>>> - Takeshi, AdWords API Team
>>>
>>> On Tuesday, August 20, 2013 6:44:44 PM UTC+9, Alan Coleman wrote:

 Hi Takeshi,

 Thanks for your reply. I'm running a script that verifies an AdWords Ad 
 against the API before storing it locally, simple stuff and it works with 
 my current Client Login set up.

 I've been through all the OAuth2 documentation and it all makes sense. 
 I've created the application identifier and added my client_id and 
 client_secret pair to my auth.ini and removed email and password 
 associated 
 with Client Login. Is this all I need to do to implement OAuth2 ? If so, I 
 don't understand why I'm still be ing asked for the email and password 
 pair.

 Also, I am correct in thinking that Client Login has been deprecated in 
 v201306?

 Many thanks

 On Tuesday, August 20, 2013 10:12:19 AM UTC+1, Takeshi Hagikura 
 (AdWords API Team) wrote:
>
> Hi Alan, 
>
> What script are you running when you see a validation error?
> Please see this 
> guide on 
> OAuth2 introduction with PHP. 
> If you have further questions, please let us know.
>
> Best,
> - Takeshi, AdWords API Team
>
> On Monday, August 19, 2013 2:50:20 AM UTC+9, Alan Coleman wrote:
>>
>> Hello everyone,
>>
>> I'm moving my AdWords app from Client Login to OAuth2 authentication 
>> in preparation to migrate to v201306.
>>
>> I've read the documentation and understand the concept of OAuth2 and 
>> have experimented successfully with a little Google+ login script.
>>
>> I'm confused about how my app will use OAuth2 instead of Client 
>> Login. 
>>
>> In *auth.ini* I've replaced the* Client Login'*s *email* and *
>> password* with *OAuth2*'s *client_id* and *client_secret* from the 
>> api console but I immediately receive a validation error asking for 
>> email 
>> and password values.
>>
>> I was under the impression that the existence of client_id and 
>> client_secret would prompt the use of OAuth2 ?
>>
>> As always any pointers would be greatly appreciated.
>>
>> I'm using library: adwords_api_php_4.2.5 version: v201302
>>
>> Many thanks
>>
>>
>>
>>
>>
>>  
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group 

Re: An error has occurred: { "error" : "invalid_grant" }

2013-08-20 Thread Takeshi Hagikura (AdWords API Team)
Hi Jur,

Sorry I didn't mean to post client id and client secret. 
I wanted to know what account did use to get your client id and client 
secret.

If you used your MCC account under which your test account is in or the 
test account itself for getting client id and secret,
the CampaignService.get should work. 

Also I wanted to confirm the xml request log for CampaignService.get. 
Specifically clientCustomerId (for your test account) was included in the 
soap header. 

Best,
- Takeshi,

On Tuesday, August 20, 2013 8:54:23 PM UTC+9, Jur wrote:
>
> Hello Takeshi,
>
> Clientid: xxx
> Client_secreat:xxx
>
> I use the standard getCampainsExample function:
>
> // Include the AdWordsUser
> require_once LIB_PATH . '/AdWordsUser.php';
>
> function GetCampaignsExample(AdWordsUser $user) {
>   // Get the service, which loads the required classes.
>   $campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);
>
>   // Create selector.
>   $selector = new Selector();
>   $selector->fields = array('Id', 'Name');
>   $selector->ordering[] = new OrderBy('Name', 'ASCENDING');
>
>   // Create paging controls.
>   $selector->paging = new Paging(0, 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>
>   do {
> // Make the get request.
> $page = $campaignService->get($selector);
>
> // Display results.
> if (isset($page->entries)) {
>   foreach ($page->entries as $campaign) {
> printf("Campaign with name '%s' and ID '%s' was found.\n",
> $campaign->name, $campaign->id);
>   }
> } else {
>   print "No campaigns were found.\n";
> }
>
> // Advance the paging index.
> $selector->paging->startIndex += 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE;
>   } while ($page->totalNumEntries > $selector->paging->startIndex);
> }
>
> try {
>   // Get AdWordsUser from credentials in "../auth.ini"
>   // relative to the AdWordsUser.php file's directory.
>   $user = new AdWordsUser();
>   // Log every SOAP XML request and response.
>   $user->LogAll();
>   
>   // Run the example.
>   GetCampaignsExample($user);
> } catch (Exception $e) {
> print_r($e);
>   printf("An error has occurred: %s\n", $e->getMessage());
> }
>
>
> Op maandag 19 augustus 2013 10:30:24 UTC+2 schreef Takeshi Hagikura 
> (AdWords API Team):
>>
>> Hi Jur, 
>>
>> What clientId and clientSecret are you passing to the script when you run 
>> the GetRefreshToken.php script?
>> And can you please share the request xml when you run the GetCampaign 
>> (except for the sensitive info)? 
>>
>> Best,
>> - Takeshi, AdWords API Team
>>
>>
>> On Friday, August 9, 2013 1:15:48 AM UTC+9, Jur wrote:
>>>
>>> Hello Guys,
>>>  
>>> I'm working on my first Google Adwords API application, but I can't get 
>>> passed the oauth2 verification.
>>> I could get a refresh_token with the GetRefreshToken.php script, but I 
>>> get the error : An error has occurred: { "error" : "invalid_grant" } when I 
>>> request a list of campaines in my test account.
>>>  
>>> Hope someone can help me out in the right direction.
>>>  
>>> Regards,
>>>  
>>> Jur
>>>  
>>> MMC id : 916-243-9387
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Adding sitelink to AdGroup via API returns error

2013-08-20 Thread Heidi Schuster

Hi there, I have managed to add a sitelink to a campaign using the 
following code:

Sitelink[] links = new Sitelink[]{new Sitelink("API TEST", 
"http://bla.com";)};
SitelinksExtension se = new SitelinksExtension();
se.setSitelinks(links);

CampaignAdExtension ad = new CampaignAdExtension();
ad.setCampaignId(131958273L);
ad.setAdExtension(se);
CampaignAdExtensionOperation[] ops = new 
CampaignAdExtensionOperation[]{new 
CampaignAdExtensionOperation(Operator.ADD, null, ad)};

CampaignAdExtensionServiceInterface service = 
adWordsUser.getService(AdWordsService.V201302.CAMPAIGN_AD_EXTENSION_SERVICE);
CampaignAdExtensionReturnValue result = service.mutate(ops);


However when I do the same thing using AdExtensionOverrideServiceInterface 
I am getting an error on SitelinksExtension.id:

  [AdExtensionOverrideError.INVALID_ADEXTENSION_ID @ 
operations[0].operand.adExtension.id; trigger:'']

I am adding the sitelink so it shouldn't be complaining that the id is 
null. If I set the id to a value it tells me it is invalid.

Also the sitelink that was added to the campaign shows as '(Not upgraded)'. 
Why is that?
 
 Thank you, Heidi

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Retrieving Adhoc Reports using OAuth

2013-08-20 Thread Alistair Ballantine
I'm having a little difficulty figuring out how to Download AdHoc reports 
using OAuth2 as the authentication mechanism. I can retrieve an 
access_token just fine using OAuth, but I only ever get the 
error GOOGLE_ACCOUNT_COOKIE_INVALID when using it. I can successfully 
connect and download a report using the old ClientLogin method, and I'm 
wondering if I'm missing a step in OAuth that would retrieve an "authToken" 
or if there's some other change to the headers I have to make to pull the 
report. 

The headers I'm using for downloading a report are effectively (in PHP):

'Authorization: GoogleLogin auth=' . $access_token,
'clientCustomerId: ' . $client_id,
'developerToken: ' . $dev_token

The $access token is what would be retrieved as a response to this 
essential POST request (taken from 
https://developers.google.com/accounts/docs/OAuth2WebServer?csw=1#refresh)

POST /o/oauth2/token HTTP/1.1
Host: accounts.google.com
Content-Type: application/x-www-form-urlencoded

client_id=8819981768.apps.googleusercontent.com&
client_secret={client_secret}&
refresh_token=1/6BMfW9j53gdGImsiyUH5kU5RsR4zwI9lUVX-tqf8JXQ&
grant_type=refresh_token

Am I using the wrong token? Am I missing a step? Should I change the Adhoc 
report HTTP Headers? Any guidance or direction would be much appreciated. 

Thank you 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Adding sitelinks to AdGroups via API

2013-08-20 Thread Heidi Schuster

Hi there, I have managed to add a sitelink to a campaign using the 
following code:

Sitelink[] links = new Sitelink[]{new Sitelink("API TEST", 
"http://bla.com";)};
SitelinksExtension se = new SitelinksExtension();
se.setSitelinks(links);

CampaignAdExtension ad = new CampaignAdExtension();
ad.setCampaignId(131958273L);
ad.setAdExtension(se);
CampaignAdExtensionOperation[] ops = new 
CampaignAdExtensionOperation[]{new 
CampaignAdExtensionOperation(Operator.ADD, null, ad)};

CampaignAdExtensionServiceInterface service = 
adWordsUser.getService(AdWordsService.V201302.CAMPAIGN_AD_EXTENSION_SERVICE);
CampaignAdExtensionReturnValue result = service.mutate(ops);


However when I do the same thing using AdExtensionOverrideServiceInterface 
I am getting an error on SitelinksExtension.id:

  [AdExtensionOverrideError.INVALID_ADEXTENSION_ID @ 
operations[0].operand.adExtension.id; trigger:'']

I am adding the sitelink so it shouldn't be complaining that the id is 
null. If I set the id to a value it tells me it is invalid.

Also the sitelink that was added to the campaign shows as '(Not upgraded)'. 
Why is that?


thank you,
 Heidi

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Getting AuthenticationError.OAUTH_TOKEN_REVOKED Exception

2013-08-20 Thread Gunnar Radzom


We have a tool that is downloading data (campaigns, adgroups, adgroupads 
and adgroupcriterions) from the adwords api.

https://developers.google.com/adwords/api/index

We used the version v201302 and recently switched to the latest version v201306 
of the api.

 

We use up to 20 Tasks to send requests parallel to the api (as suggested by 
google).

We are aware of Exceptions like 

-  AuthenticationError.OAUTH_TOKEN_EXPIRED

-  SizeLimitError.RESPONSE_SIZE_LIMIT_EXCEEDED

-  InternalApiError.UNEXPECTED_INTERNAL_API_ERROR

And act by refreshing the oauth token if necessary, using paging to get the 
data and sending the task to sleep for short periods of time if the api 
complains about too many requests.

 

As of late we experience another exception:

 

Exception:

Google.Api.Ads.AdWords.Lib.AdWordsApiException: An API exception has 
occurred. See ApiException and InnerException fields for more details. ---> 
System.Web.Services.Protocols.SoapException: 
[AuthenticationError.OAUTH_TOKEN_REVOKED @ ; trigger:'']

   at 
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
 
message, WebResponse response, Stream responseStream, Boolean asyncCall)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
methodName, Object[] parameters)

   at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String 
methodName, Object[] parameters)

   --- End of inner exception stack trace ---

   at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String 
methodName, Object[] parameters)

   at Google.Api.Ads.Common.Lib.AdsSoapClient.Invoke(String methodName, 
Object[] parameters)

   at Google.Api.Ads.AdWords.v201306.CampaignService.get(Selector 
serviceSelector)

 

The tool runs fine for several hours and then the exception happens.

It seems that we can eliminate the possibility of someone revoking the 
authorization manually since the exception always happens deep in the night 
between 3 am and 5 am*. *

*So what else could cause a revocation of the access token?*

 

For OAuth we use a google business account with a service account for 
adwords api

 

Our configuration for oauth looks like this (all values in “ ” are just 
placeholders because of security reasons)

 

”xxx-xxx-”

”path to certificate 
file”

notasecret

”our developer token”

sem@”mycompany”.mygbiz.com

”UserAgent”


”id”@developer.gserviceaccount.com

1

 

 

*Could it help to increase the value for RetryCount  in the config?*

* *

*Is it possible that the problems are related to the switch to the new api?*

* *

 

 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Test Account

2013-08-20 Thread Павел Силенко
There is a test account, ID client: 374-873-6083, for any given query 
error: QuotaCheckError.INCOMPLETE_SIGNUP

Help solve the problem!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Stats for keyword are reproduced and shwon for wrong ads

2013-08-20 Thread David Morawitzky

Hey, 
in my project I am trying to get stats for every keyword in the form of:
campaign_ID
campaign_Name
adGroup_ID
adGroup_Name
ad_ID
ad_Header
targetURL
keyword_id
keyword_text
matchtype
network
average_position
clicks
impressions
ctr
qualityfactor
cost
average_cpc
I am using AdGroupCriterionService, AdGroupAdService, and AdGroupService 
and get data for all the points.
But the problem is, that the output seems to be focused on the adGroup.
So I get for each ad in the adgroup the same stats, no matter what keyword 
belongs to it. Also if some ads didn't even get one impression.
It's hard to describe, my English is bad.
Here is an example of my output:

(

[0] => Array

(

[date_start] => 2013-08-18

[date_end] => 2013-08-18

[campaign_Id] => 49230926

[campaign_Name] => xxx

[adGroup_Id] => 1172464046

[adGroup_Name] => Zweitwagenversicherung

[ad_ID] => 4605933386

[ad_Header] => xxx

[targetURL] => xxx

[keyword_id] => 12944618306

[keyword] => zweitwagen versichern

[matchtype] => EXACT

[network] => SEARCH

[average_position] => 1

[clicks] => 2

[impressions] => 1

[ctr] => 2

[qualityfactor] => 10

[cost] => 2.62

[average_cpc] => 1.31

)

 [1] => Array

(

 [date_start] => 2013-08-18

[date_end] => 2013-08-18

[campaign_Id] => 49230926

[campaign_Name] => xxx

[adGroup_Id] => 1172464046

[adGroup_Name] => Zweitwagenversicherung

[ad_ID] => 13424137106

[ad_Header] => Zweitwagenvers.

[targetURL] => xxx

[keyword_id] => 12944618306

[keyword] => zweitwagen versichern

[matchtype] => EXACT

[network] => SEARCH

[average_position] => 1

[clicks] => 2

[impressions] => 1

[ctr] => 2

[qualityfactor] => 10

[cost] => 2.62

 [average_cpc] => 1.31

)
The places marked with x get data, I just didn't want to show. Sorry ;)
As you see, there is the same keyword twice. Different ads, but the same 
stats. The second ad must have 0 impressions.
Do you have any idea what could be wrong?
If it would help you I could post my code. Pretty long and not pretty.
I am really new to adwords.
Hope you can help me.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: PHP Client Library and Deprecated Services

2013-08-20 Thread Alistair Ballantine
Ah, okay - I figured it would end up being a misunderstanding on my part. 
Thank you for the information. 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Getting AuthenticationError.OAUTH_TOKEN_REVOKED

2013-08-20 Thread Gunnar Radzom


We have a tool that is downloading data (campaigns, adgroups, adgroupads 
and adgroupcriterions) from the adwords api.

https://developers.google.com/adwords/api/index

We used the version v201302 and recently switched to the latest version v201306 
of the api.

 

We use up to 20 Tasks to send requests parallel to the api (as suggested by 
google).

We are aware of Exceptions like 

-  AuthenticationError.OAUTH_TOKEN_EXPIRED

-  SizeLimitError.RESPONSE_SIZE_LIMIT_EXCEEDED

-  InternalApiError.UNEXPECTED_INTERNAL_API_ERROR

And act by refreshing the oauth token if necessary, using paging to get the 
data and sending the task to sleep for short periods of time if the api 
complains about too many requests.

 

As of late we experience another exception:

 

Exception:

Google.Api.Ads.AdWords.Lib.AdWordsApiException: An API exception has 
occurred. See ApiException and InnerException fields for more details. ---> 
System.Web.Services.Protocols.SoapException: 
[AuthenticationError.OAUTH_TOKEN_REVOKED @ ; trigger:'']

   at 
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
 
message, WebResponse response, Stream responseStream, Boolean asyncCall)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
methodName, Object[] parameters)

   at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String 
methodName, Object[] parameters)

   --- End of inner exception stack trace ---

   at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String 
methodName, Object[] parameters)

   at Google.Api.Ads.Common.Lib.AdsSoapClient.Invoke(String methodName, 
Object[] parameters)

   at Google.Api.Ads.AdWords.v201306.CampaignService.get(Selector 
serviceSelector)

 

The tool runs fine for several hours and then the exception happens.

It seems that we can eliminate the possibility of someone revoking the 
authorization manually since the exception always happens deep in the night 
between 3 am and 5 am*. *

*So what else could cause a revocation of the access token?*

 

For OAuth we use a google business account with a service account for 
adwords api

 

Our configuration for oauth looks like this (all values in “ ” are just 
placeholders because of security reasons)

 

”xxx-xxx-”

”path to certificate 
file”

notasecret

”our developer token”


sem@”mycompany”.mygbiz.com

”UserAgent”


”id”@developer.gserviceaccount.com

1

 

 

*Could it help to increase the value for RetryCount  in the config?*

* *

*Is it possible that the problems are related to the switch to the new api?*

* *

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Receiving QuotaCheckError.INCOMPLETE_SIGNUP

2013-08-20 Thread gapi
I have the same error.

I have entered my billing information (Visa)!!!

I waste a lot time because i didn't get my Refresh_token 

1. i removed in getrefreshtoken.php:

if (__FILE__ != realpath($_SERVER['PHP_SELF'])) {
// return  ;
}

2. i copied the Token from redirected url into:
 $user->SetOAuth2Info(
$OAuth2Handler->GetAccessToken(
$user->GetOAuth2Info(), 
"4/nR8XX", $redirectUri));

this did not work:
$OAuth2Handler->GetAccessToken(
$user->GetOAuth2Info(), $code, $redirectUri));

After 2 Days i have now my refresh_token

And now i have the error on getcampaings.php

An error has occurred: [QuotaCheckError.INCOMPLETE_SIGNUP @ ; trigger:'']

What can i do?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: TargetingIdeaService return keywords stats not matched with Web UI.

2013-08-20 Thread Danial Klimkin
Hello Chirag,


Looking on the code below, the network parameter is not specified correctly:

$networkTargetParameter = new NetworkSearchParameter();
  $networksetting = new NetworkSetting();
  $networksetting->SearchParameterType = 'targetGoogleSearch';
  $networkTargetParameter->networkSetting = $networksetting;

Please see the structure here:

https://developers.google.com/adwords/api/docs/reference/latest/TargetingIdeaService.NetworkSearchParameter

You need to provide "true" or "false" values for every option (partner 
network is optional).

Let us know if the result still differ with the UI when you specify only 
targetGoogleSearch == true. Please provide exact XML (not PHP) code for the 
request in this case.


-Danial, AdWords API Team.


On Friday, August 16, 2013 2:12:18 PM UTC+4, Chirag wrote:
>
> Hello Danial,
>
> Yes after selecting google and search partner i am getting Search volume 
> properly.
> But avg CPC data is still not matched. and to find UI data i need option 
> to get data on previous dates.
> How i can find avg cpc on previous dates data.
>
> Also one more question.
>
> Using API i am only passing google as targetting than why API is giving me 
> data for Google and search partners?
>
> Thanks,
>
>
>
> On Friday, 16 August 2013 14:12:50 UTC+5:30, Danial Klimkin wrote:
>>
>> Hello Chirag,
>>
>>
>> Please check the UI numbers with "Google and search partners" instead of 
>> "Google" option on the left. Do they match in this case?
>>
>>
>> -Danial, AdWords API Team.
>>
>>
>> On Thursday, August 15, 2013 10:11:39 PM UTC+4, Chirag wrote:
>>>
>>> Hello Danial,
>>>
>>> I am using same parameter,but i am not getting same result as UI. You 
>>> can see the diffrence.
>>> * API value 
>>> * * UI 
>>> value  *
>>> Keyword   Search volume AVG CPC 
>>> (Micro Amount)  Search volume AVG CPC  
>>>
>>> in home senior care 1000   216846693
>>>  880 $3.80
>>>
>>> senior care services 880   214674314
>>>  590$3.68
>>>
>>> senior home care5400   251675313
>>> 3600$4.25
>>>
>>> elder home care  390   
>>> 195457037  210$3.79
>>>
>>>
>>> Please see my code. Also see the UI Image attached here with.
>>> $targetingIdeaService =
>>>   $user->GetService('TargetingIdeaService', ADWORDS_VERSION);
>>>
>>>   // Create seed keyword.
>>>   $keyword = array('in home senior care','senior care services','senior 
>>> home care','elder home care');
>>>
>>>   // Create selector.
>>>   $selector = new TargetingIdeaSelector();
>>>   $selector->requestType = 'STATS';
>>>   $selector->ideaType = 'KEYWORD';
>>>   $selector->requestedAttributeTypes = array('KEYWORD_TEXT', 
>>> 'SEARCH_VOLUME',
>>>   'CATEGORY_PRODUCTS_AND_SERVICES', 'COMPETITION', 'AVERAGE_CPC', 
>>> 'TARGETED_MONTHLY_SEARCHES');
>>>
>>>   // Create language search parameter (optional).
>>>   // The ID can be found in the documentation:
>>>   //   
>>> https://developers.google.com/adwords/api/docs/appendix/languagecodes
>>>   // Note: As of v201302, only a single language parameter is allowed.
>>>   $languageParameter = new LanguageSearchParameter();
>>>   $english = new Language();
>>>   $english->id = 1000;
>>>   $languageParameter->languages = array($english);
>>>   
>>>   $locationTargetParameter = new LocationSearchParameter();
>>>   $location = new location();
>>>   $location->id = 2840;
>>>   $locationTargetParameter->locations = $location;
>>>   
>>>   $networkTargetParameter = new NetworkSearchParameter();
>>>   $networksetting = new NetworkSetting();
>>>   $networksetting->SearchParameterType = 'targetGoogleSearch';
>>>   $networkTargetParameter->networkSetting = $networksetting;
>>>
>>>   // Create related to query search parameter.
>>>   $relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
>>>   $relatedToQuerySearchParameter->queries = $keyword;
>>>   $selector->searchParameters[] = $relatedToQuerySearchParameter;
>>>   $selector->searchParameters[] = $languageParameter;
>>>   $selector->searchParameters[] = $locationTargetParameter;
>>>   $selector->searchParameters[] = $networkTargetParameter;
>>>
>>>   // Set selector paging (required by this service).
>>>   $selector->paging = new Paging(0, 
>>> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>>>
>>>   do {
>>> // Make the get request.
>>> $page = $targetingIdeaService->get($selector);
>>> // Display results.
>>> if (isset($page->entries)) {
>>>   foreach ($page->entries as $targetingIdea) {
>>> $data = MapUtils::GetMap($targetingIdea->data);
>>>  

Issues running GetRefreshToken.php

2013-08-20 Thread Alan Coleman
Hello everyone,

I'm trying to get hold of a refresh_token for my auth.ini file

I understand from the 
guidethat I need 
to run GetRefreshToken.php, however there doesn't seem to be 
much advice on actually *how* to run this file.

At the moment I'm running the file through the command line locally like 
this: . \examples\adwords\Auth>php GetRefreshToken.php

I'm receiving a PHP Catchable Fatal Error.

Am I running this GetRefreshToken in the right place? Do I need to carry 
arguments across?

Any help would be appreciated.

Many thanks 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Issues running GetRefreshToken.php

2013-08-20 Thread Ewan Heming
Hi Alan,

What's the error you're getting?

Regards,

Ewan

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Dynamic Ads Reporting

2013-08-20 Thread Takeshi Hagikura (AdWords API Team)
Hi, 

There are only beta features available for Dynamic Search Ads, Keywordless 
category 
reportand
 Keywordless 
query 
report
.

Best,
- Takeshi, 

On Monday, August 19, 2013 10:40:51 PM UTC+9, Valerii Buzivskyi wrote:
>
> Hi.
>
> Is it possible to export statistic for dynamic ads  via API, or its still 
> unsupported?
>
> We are using some parameters such as DYNAMIC_SEARCH_AD, but still get no 
> any data.
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: TargetingIdeaService return keywords stats not matched with Web UI.

2013-08-20 Thread Chirag
Hello Danial,

Thanks for info, Yes this was corrected by me earlier.

My main issue is how i can get previous month / previous date *AVG CPC*data?
As now adwords api *TargetingIdeaService* changed from UI of keywords 
planner tool. And you said earlier that UI is AVG value where in API we 
found exact value for AVG CPC.

So Please guide me how to get previous dates AVG CPC using adwords api. As 
i am not finding any date parameter that can be pass using *
TargetingIdeaService.*

Thanks For all Your help.

Chirag

On Tuesday, 20 August 2013 21:49:29 UTC+5:30, Danial Klimkin wrote:
>
> Hello Chirag,
>
>
> Looking on the code below, the network parameter is not specified 
> correctly:
>
> $networkTargetParameter = new NetworkSearchParameter();
>   $networksetting = new NetworkSetting();
>   $networksetting->SearchParameterType = 'targetGoogleSearch';
>   $networkTargetParameter->networkSetting = $networksetting;
>
> Please see the structure here:
>
>
> https://developers.google.com/adwords/api/docs/reference/latest/TargetingIdeaService.NetworkSearchParameter
>
> You need to provide "true" or "false" values for every option (partner 
> network is optional).
>
> Let us know if the result still differ with the UI when you specify only 
> targetGoogleSearch == true. Please provide exact XML (not PHP) code for the 
> request in this case.
>
>
> -Danial, AdWords API Team.
>
>
> On Friday, August 16, 2013 2:12:18 PM UTC+4, Chirag wrote:
>>
>> Hello Danial,
>>
>> Yes after selecting google and search partner i am getting Search volume 
>> properly.
>> But avg CPC data is still not matched. and to find UI data i need option 
>> to get data on previous dates.
>> How i can find avg cpc on previous dates data.
>>
>> Also one more question.
>>
>> Using API i am only passing google as targetting than why API is giving 
>> me data for Google and search partners?
>>
>> Thanks,
>>
>>
>>
>> On Friday, 16 August 2013 14:12:50 UTC+5:30, Danial Klimkin wrote:
>>>
>>> Hello Chirag,
>>>
>>>
>>> Please check the UI numbers with "Google and search partners" instead of 
>>> "Google" option on the left. Do they match in this case?
>>>
>>>
>>> -Danial, AdWords API Team.
>>>
>>>
>>> On Thursday, August 15, 2013 10:11:39 PM UTC+4, Chirag wrote:

 Hello Danial,

 I am using same parameter,but i am not getting same result as UI. You 
 can see the diffrence.
 * API value   
   * * UI 
 value  *
 Keyword   Search volume AVG CPC 
 (Micro Amount)  Search volume AVG CPC  

 in home senior care 1000   216846693   
   880 $3.80

 senior care services 880   214674314   
   590$3.68

 senior home care5400   251675313   
  3600$4.25

 elder home care  390   
 195457037  210$3.79


 Please see my code. Also see the UI Image attached here with.
 $targetingIdeaService =
   $user->GetService('TargetingIdeaService', ADWORDS_VERSION);

   // Create seed keyword.
   $keyword = array('in home senior care','senior care services','senior 
 home care','elder home care');

   // Create selector.
   $selector = new TargetingIdeaSelector();
   $selector->requestType = 'STATS';
   $selector->ideaType = 'KEYWORD';
   $selector->requestedAttributeTypes = array('KEYWORD_TEXT', 
 'SEARCH_VOLUME',
   'CATEGORY_PRODUCTS_AND_SERVICES', 'COMPETITION', 'AVERAGE_CPC', 
 'TARGETED_MONTHLY_SEARCHES');

   // Create language search parameter (optional).
   // The ID can be found in the documentation:
   //   
 https://developers.google.com/adwords/api/docs/appendix/languagecodes
   // Note: As of v201302, only a single language parameter is allowed.
   $languageParameter = new LanguageSearchParameter();
   $english = new Language();
   $english->id = 1000;
   $languageParameter->languages = array($english);
   
   $locationTargetParameter = new LocationSearchParameter();
   $location = new location();
   $location->id = 2840;
   $locationTargetParameter->locations = $location;
   
   $networkTargetParameter = new NetworkSearchParameter();
   $networksetting = new NetworkSetting();
   $networksetting->SearchParameterType = 'targetGoogleSearch';
   $networkTargetParameter->networkSetting = $networksetting;

   // Create related to query search parameter.
   $relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
   $relatedToQu