New enums

2014-11-27 Thread Rasmus Ladekjær Pedersen
You have changed some enums, e.g.

https://developers.google.com/adwords/api/docs/reference/v201406/CampaignService.CampaignStatus

to 

https://developers.google.com/adwords/api/docs/reference/v201409/CampaignService.CampaignStatus

Please put this in the migration guide. Also, please add new enums to the 
end of the list.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e745842e-0064-4c99-8870-64a5821bacd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Changing budget name on deletion

2014-04-09 Thread Rasmus Ladekjær Pedersen
Sure, that works. It is a bit chatty though. I thought it possibly to 
change multiple parameters in one request to the server, and when I try to 
change both name and status (to deleted) I do not recieve any errors. It 
fails silently.



On Wednesday, April 9, 2014 10:23:49 PM UTC+2, Ray Tsang (AdWords API Team) 
wrote:
>
> Ramsus,
>
> Could I trouble you to try this in 2 phases?
>
>1. Change the budget name and save
>2. Set the satus and save
>
> Let me know if that works for you.
>
> Thanks,
>
> Ray
>
> On Wednesday, April 9, 2014 12:57:36 PM UTC-4, Rasmus Ladekjær Pedersen 
> wrote:
>>
>> Due to constraint that names of budgets must be uniq I am trying change 
>> the budget name as a budget is deleted. I C# using the client library I use 
>> the following code
>>
>> string now = DateTime.UtcNow.ToString("-MM-dd hh:mm:ss");
>> budget.name = String.Format("{0} (deleted {1})", budget.name, now);
>> budget.status = BudgetBudgetStatus.DELETED;
>> var operations = new List();
>> operations.Add(new BudgetOperation {operand = budget, @operator = 
>> Operator.REMOVE});
>> var service = (BudgetService) 
>> _user.GetService(AdWordsService.v201402.BudgetService);
>> operations.ForEach(part => service.mutate(part));
>>
>> In the above code, budget is earlier retrieved from the API and hence 
>> holding the budget id.
>>
>> Running the code, the budget is deleted, but the budget name is not 
>> changed.
>>
>> What am I doing wrong?
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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/d/optout.


Changing budget name on deletion

2014-04-09 Thread Rasmus Ladekjær Pedersen
Due to constraint that names of budgets must be uniq I am trying change the 
budget name as a budget is deleted. I C# using the client library I use the 
following code

string now = DateTime.UtcNow.ToString("-MM-dd hh:mm:ss");
budget.name = String.Format("{0} (deleted {1})", budget.name, now);
budget.status = BudgetBudgetStatus.DELETED;
var operations = new List();
operations.Add(new BudgetOperation {operand = budget, @operator = 
Operator.REMOVE});
var service = (BudgetService) 
_user.GetService(AdWordsService.v201402.BudgetService);
operations.ForEach(part => service.mutate(part));

In the above code, budget is earlier retrieved from the API and hence 
holding the budget id.

Running the code, the budget is deleted, but the budget name is not changed.

What am I doing wrong?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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/d/optout.


Any plans for a JavaScript library?

2014-04-07 Thread Rasmus Ladekjær Pedersen
Hi there,

do you have any plans for a JavaScript library?

With all the Node.js going on, I believe we are a lot wanting a JavaScript 
library for the Google AdWords API.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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/d/optout.


Re: Client Secret for Service Account

2014-01-16 Thread Rasmus Ladekjær Pedersen
Click on "Create New Client Id". Pick "Installed application" and then 
"Other". Click "Create "Client Id".



On Tuesday, January 14, 2014 1:13:39 AM UTC+1, Rodrigo Reis wrote:
>
> I have a bunch of Python Scripts running in my back-end and they 
> communicate with the AdWords API without user interaction.
> I'm trying to setup OAuth authentication.. so far I've created a new key 
> of type Service Account (since we don't have user interaction).
> On the api console I just see Client ID, Email address, Public key 
> fingerprints.. where can I get the client secret? See enclosed file.
>
> Thanks,
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: AWQL -- query only Records with Impressions, Clicks, or Conversions > 0

2014-01-14 Thread Rasmus Ladekjær Pedersen
You can see the formal grammar here 
https://developers.google.com/adwords/api/docs/guides/awql under Formal 
Grammar. There is no support for OR i AWQL.

A solution could be to use node-gawr to 
fetch the data and then filter with grep (on Linux/Mac OS X) or 
String-Select (on Windows (PowerShell)).






On Friday, January 10, 2014 8:39:40 PM UTC+1, Brandon Patrick wrote:
>
> Using reporting, I only want to pull ads where one of these stats -- 
> Impressions, Clicks, Conversions -- is greater than zero. In MySQL I would 
> do something like this:
>
> SELECT Id, Impressions, Clicks, Conversions, Status FROM 
> AD_PERFORMANCE_REPORT WHERE CampaignId = $remote_service_ID AND 
> (Impressions > 0 OR Clicks > 0 OR Conversions > 0) DURING $dateRange
>
> But as far as I can tell there is no support for "OR" in AWQL. Can you 
> recommend a way to do this?
>
> Thanks,
> Brandon
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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: Commandline reporting tool

2014-01-07 Thread Rasmus Ladekjær Pedersen
Thanks alot mr. Oommen. 

Gawr now functions with OAuth 2.0. It is not pretty yet, but it will be 
eventually.


On Friday, January 3, 2014 3:21:48 PM UTC+1, Anash P. Oommen (AdWords API 
Team) wrote:
>
> Hi Rasmus,
>
> You could use the OAuth playground to generate access token, but as you 
> noticed, the access token expires in an hour. This is good for short demo 
> purposes, but if you want a long-running process or an unattended cron job, 
> this approach won't work. Plus, our servers will see your application as 
> "OAuth Playground", since you are using its clientId to generate access 
> token. If you want to identify your application as Gawr (and hence get your 
> own rate limits, settings, etc.) then you should register your own client 
> id and secret from Google Cloud console and then generate OAuth access / 
> refresh token using those credentials.
>
> OAuth2 is a bit more difficult to implement when compared to ClientLogin, 
> but since it is an open standard, there are lots of libraries that 
> implement the protocol for you. You could use one of those to do the OAuth2 
> flow, and then use the access token to make AdWords API calls. A quick 
> google search brought up this library: 
> http://andreareginato.github.io/simple-oauth2/. It seems to support both 
> the authorization flow and access token refresh flow.
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.
>
> On Thursday, January 2, 2014 10:11:31 PM UTC-5, Rasmus Ladekjær Pedersen 
> wrote:
>>
>> Thank you for your interest. I have added the possibility to use a 
>> --customerId flag to specify a client customer id other than the one in 
>> config. Good idea. Thanks. I have also corrected a few bugs.
>>
>> The OAuth 2.0 part is however rather hard on me. Gawr is now using OAuth 
>> 2.0 in a preliminary way. The users obtain an access token via 
>> https://developers.google.com/oauthplayground and the program will work 
>> for an hour. Obviously, the refresh token should be used.
>>
>> My answer is why are you taking about 
>> https://cloud.google.com/console#/project, clientId and clientSecret. 
>> What am I missing?
>>
>> I would be glad to hear anything from your or your colleague.
>>
>>
>>
>> On Tuesday, December 17, 2013 3:01:12 PM UTC+1, Anash P. Oommen (AdWords 
>> API Team) wrote:
>>>
>>> Hi Rasmus,
>>>
>>> That's a pretty useful script. I've heard a few users asking for one, 
>>> but it's the first time I'm seeing a user write one and contribute to the 
>>> community. Thanks a lot! One of my colleagues was experimenting with 
>>> AdWords API on Node.js, I'll ask him to take a look and reach out to you.
>>>
>>> I have a couple of suggestions: 
>>>
>>>
>>>- It is useful to have a --customerId flag that reads from config if 
>>>one is not provided on the command line. That way, one could switch 
>>>customer ids on command line w/o changing the config.
>>>- You should try to use OAuth2 as authentication mechanism, since 
>>>ClientLogin protocol is deprecated and will go away in the next 6 
>>> months. 
>>>The rough steps to generate one using OAuth 2.0 Playground would be as 
>>>follows (I apologize, I don't have a handy guide to point you to in our 
>>>documentation site):
>>>   - Visit Google Cloud Console. 
>>>   https://cloud.google.com/console#/project
>>>   - Create a new project, then register a *web* application. 
>>>   Provide https://developers.google.com/oauthplayground a callback 
>>>   url. This will give you an OAuth2 *clientId *and *clientSecret*.
>>>   - Visit https://developers.google.com/oauthplayground/. Click the 
>>>   OAuth2.0 configuration button on the top right corner, and check "Use 
>>> your 
>>>   own OAuth credentials". Add the OAuth2 clientId and clientSecret from 
>>> the 
>>>   Google cloud console on this page, and Save.
>>>   - Do the OAuth2 flow on the main application, for scope = 
>>> *https://adwords.google.com/api/adwords 
>>>   <https://adwords.google.com/api/adwords>. *At the end of the 
>>>   flow, the page will print out a refresh token and an access token.
>>>   - In your application, you need to send the authorization header 
>>>   as *Authorization: Bearer access_token* instead of Authorization 
>>>   GoogleLogin...
>>>   - Access tokens will expire in an hour, but you c

Re: Commandline reporting tool

2014-01-02 Thread Rasmus Ladekjær Pedersen
Thank you for your interest. I have added the possibility to use a 
--customerId flag to specify a client customer id other than the one in 
config. Good idea. Thanks. I have also corrected a few bugs.

The OAuth 2.0 part is however rather hard on me. Gawr is now using OAuth 
2.0 in a preliminary way. The users obtain an access token via 
https://developers.google.com/oauthplayground and the program will work for 
an hour. Obviously, the refresh token should be used.

My answer is why are you taking about 
https://cloud.google.com/console#/project, clientId and clientSecret. What 
am I missing?

I would be glad to hear anything from your or your colleague.



On Tuesday, December 17, 2013 3:01:12 PM UTC+1, Anash P. Oommen (AdWords 
API Team) wrote:
>
> Hi Rasmus,
>
> That's a pretty useful script. I've heard a few users asking for one, but 
> it's the first time I'm seeing a user write one and contribute to the 
> community. Thanks a lot! One of my colleagues was experimenting with 
> AdWords API on Node.js, I'll ask him to take a look and reach out to you.
>
> I have a couple of suggestions: 
>
>
>- It is useful to have a --customerId flag that reads from config if 
>one is not provided on the command line. That way, one could switch 
>customer ids on command line w/o changing the config.
>- You should try to use OAuth2 as authentication mechanism, since 
>ClientLogin protocol is deprecated and will go away in the next 6 months. 
>The rough steps to generate one using OAuth 2.0 Playground would be as 
>follows (I apologize, I don't have a handy guide to point you to in our 
>documentation site):
>   - Visit Google Cloud Console. 
>   https://cloud.google.com/console#/project
>   - Create a new project, then register a *web* application. Provide 
>   https://developers.google.com/oauthplayground a callback url. This 
>   will give you an OAuth2 *clientId *and *clientSecret*.
>   - Visit https://developers.google.com/oauthplayground/. Click the 
>   OAuth2.0 configuration button on the top right corner, and check "Use 
> your 
>   own OAuth credentials". Add the OAuth2 clientId and clientSecret from 
> the 
>   Google cloud console on this page, and Save.
>   - Do the OAuth2 flow on the main application, for scope = 
> *https://adwords.google.com/api/adwords 
>   <https://adwords.google.com/api/adwords>. *At the end of the flow, 
>   the page will print out a refresh token and an access token.
>   - In your application, you need to send the authorization header as 
> *Authorization: 
>   Bearer access_token* instead of Authorization GoogleLogin...
>   - Access tokens will expire in an hour, but you could use the 
>   refresh token to get a new access token. The raw http message for the 
> same 
>   is available here: 
>   https://developers.google.com/accounts/docs/OAuth2WebServer#refresh
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.
>
> On Monday, December 16, 2013 6:45:06 PM UTC-5, Rasmus Ladekjær Pedersen 
> wrote:
>>
>> I wrote this little node.js script to retrieve report from Google 
>> AdWords. When I myself was new to the API I would really have liked a 
>> simple script like that, and that is why I later wrote it and now post it 
>> here.
>>
>> https://github.com/ladekjaer/node-gawr
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.


Commandline reporting tool

2013-12-16 Thread Rasmus Ladekjær Pedersen
I wrote this little node.js script to retrieve report from Google AdWords. 
When I myself was new to the API I would really have liked a simple script 
like that, and that is why I later wrote it and now post it here.

https://github.com/ladekjaer/node-gawr

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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.


google-api-adwords-js

2013-10-14 Thread Rasmus Ladekjær Pedersen
Why is the google-api-adwords-js no longer maintained?

At https://code.google.com/p/google-api-adwords-js/downloads/list the 
downloadcounts seems very high.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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: Budget.associatedCampaigns in v201306

2013-08-15 Thread Rasmus Ladekjær Pedersen
Hi Danial

I guess I can do that, it just seems to be a lot less pretty solution than 
that of the v201302 API.


On Wednesday, August 7, 2013 11:59:01 AM UTC+2, Danial Klimkin wrote:
>
> Hello Rasmus,
>
>
> You can use the Budget Performance Report to find the associations:
>
>   https://developers.google.com/adwords/api/docs/appendix/reports#budget
>
>
> -Danial, AdWords API Team.
>
>
> On Monday, August 5, 2013 3:26:05 PM UTC+4, Rasmus Ladekjær Pedersen wrote:
>>
>> In the API v201302 the Budget object had a field 
>> called associatedCampaigns (
>> https://developers.google.com/adwords/api/docs/reference/v201302/BudgetService.Budget).
>>  
>> This field seems to be missing in v201306 (
>> https://developers.google.com/adwords/api/docs/reference/v201306/BudgetService.Budget
>> ).
>>
>> Using v201306. do I really have to loop though all the campaigns to see 
>> which campaigns uses a given budget?
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.


Budget.associatedCampaigns in v201306

2013-08-05 Thread Rasmus Ladekjær Pedersen
In the API v201302 the Budget object had a field called associatedCampaigns 
(
https://developers.google.com/adwords/api/docs/reference/v201302/BudgetService.Budget).
 
This field seems to be missing in v201306 (
https://developers.google.com/adwords/api/docs/reference/v201306/BudgetService.Budget
).

Using v201306. do I really have to loop though all the campaigns to see 
which campaigns uses a given budget?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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: Retrieving id’s of Ad Groups upon committing

2013-04-19 Thread Rasmus Ladekjær Pedersen
Thank you Mr. Oommen.

I have been using it, but it is nice to hear from an authority that it 
works.

I wish you a nice weekend.

Rasmus Ladekjær Pedersen



On Monday, April 15, 2013 11:47:42 AM UTC+2, Anash P. Oommen (AdWords API 
Team) wrote:
>
> HI Rasmus,
>
> You get the objects in the same order as you passed them to the server for 
> mutate call. So your approach works fine.
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.
>
> On Friday, April 12, 2013 2:50:34 PM UTC+5:30, Rasmus Ladekjær Pedersen 
> wrote:
>>
>> Hi there.
>>
>> I was wandering how you upon creation of Ad Group match the AdGroup 
>> elements from the return value to the AdGroup elements already in memory.
>>
>> I need the id’s to properly commit Ads and Keywords. Right now I am 
>> working under the assumption that the return values come in the same order 
>> as in the array I sent to Google AdWords.
>>
>> Specifically, I do this
>>
>> AdGroupReturnValue retVal = adGroupService.mutate(operations);
>>
>> foreach (AdGroup adGroup in retVal.value)
>>
>> {
>>
>> groups.ElementAt(i).id = adGroup.id;
>>
>> i++;
>>
>> }
>>
>> I thought some of you might have a better or prettier solution.
>>
>> Have a nice Friday.
>>
>> (Not that it is important, but I use C# and the official AdWords library 
>> for .Net.)
>>
>>
>> Rasmus Ladekjær Pedersen
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 id’s of Ad Groups upon committing

2013-04-12 Thread Rasmus Ladekjær Pedersen


Hi there.

I was wandering how you upon creation of Ad Group match the AdGroup 
elements from the return value to the AdGroup elements already in memory.

I need the id’s to properly commit Ads and Keywords. Right now I am working 
under the assumption that the return values come in the same order as in 
the array I sent to Google AdWords.

Specifically, I do this

AdGroupReturnValue retVal = adGroupService.mutate(operations);

foreach (AdGroup adGroup in retVal.value)

{

groups.ElementAt(i).id = adGroup.id;

i++;

}

I thought some of you might have a better or prettier solution.

Have a nice Friday.

(Not that it is important, but I use C# and the official AdWords library 
for .Net.)


Rasmus Ladekjær Pedersen

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.




Changing URL for ads of type image ad

2013-02-08 Thread Rasmus Ladekjær Pedersen
I have been changing the distinations URL of my AdWords ads using a little 
program I wrote in C#. However, then I hit ads of type image ad with 
images, the program throws an exception. Appearently I need to set 
operand.ad.image.mediaId. My program changes the URL by retrieving the ads 
in question, changing the URL, deleting them on the AdWords server and 
finally adding them again (with the new URL). For text ads it works 
perfectly.

I have read somethere that if I only retrieve field from the generic ad 
type (Ad) the program would execute without errors. I select only Id and 
Url via AWQL, so I though I was in the clear. To get the ads I use an 
AdGroupAdService to make an AdGroupAdPage. I really like to have an unified 
solution that can work for any type of ad, however, a solution just working 
for image ads is also welcome.

Have a nice day.


Some source code (C#). I appreciate any kind of suggestions or comments.


public void Remake(string campaignName, int campaignElementId, int 
contentId)
{
long campaignId = GetCampaignId(campaignName);
List groupIds = GetAdGroupIds(campaignId);
StringBuilder query = new StringBuilder("SELECT Id, Url WHERE 
AdGroupId IN [ ");
bool isFirst = true;
foreach (long groupId in groupIds)
{
if (!isFirst) query.Append(", ");
query.Append(groupId);
isFirst = false;
}
query.Append(" ]");
AdGroupAdService service = 
(AdGroupAdService)user.GetService(AdWordsService.v201209.AdGroupAdService);
AdGroupAdPage page = service.query(query.ToString());
List ads = new List();
foreach (AdGroupAd ad in page.entries)
{
ad.ad.url = NewUrl(ad, campaignElementId, contentId);
ads.Add(ad);
}
UpdateAds(ads);
}




private void UpdateAds(List ads)
{
AdGroupAdService service = 
(AdGroupAdService)user.GetService(AdWordsService.v201209.AdGroupAdService);
List removing = new 
List();
foreach (AdGroupAd ad in ads)
{
AdGroupAdOperation operation = new AdGroupAdOperation();
operation.@operator = Operator.REMOVE;
operation.operand = ad;
removing.Add(operation);
}
List adding = new 
List();
foreach (AdGroupAd ad in ads)
{
AdGroupAdOperation operation = new AdGroupAdOperation();
operation.@operator = Operator.ADD;
operation.operand = ad;
adding.Add(operation);
}
AdGroupAdReturnValue retValRemoving = 
service.mutate(removing.ToArray());
AdGroupAdReturnValue retValAdding = 
service.mutate(adding.ToArray());

}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 all ads in a campaign

2013-02-03 Thread Rasmus Ladekjær Pedersen
Hi

Is there a way to get all ads in a campaign in a single request? I can easy 
enough get all AdGroups, and then in new calls get all ads. However, in a 
situation there I e.g. want to add a parameter in all distinaitons URLs it 
would be very nice to get all ads in a campaign in only one request.

Have a nice day.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.




Keyword status (v201209, C# library)

2013-01-17 Thread Rasmus Ladekjær Pedersen
Hi.

It seems to me that the statuses in the web interface maps poorly to the 
API.

Especially I am hoping to get the statuses of my keywords. Do anyone know 
how I obtain this information?

Regards,
Rasmus Ladekjær

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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