Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread Ken Dan Tinio
Magnificent! Thank you very much!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/fa99050d-95cd-4506-afb2-926d5d850394%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
Hi Ken,

For your reporting error (QueryError.PARSING_FAILED 

), it means that there maybe some incorrect syntax in your AWQL query. 
Kindly double check on your end if your syntax and spacing is correct. 
Based on your first code snippet, it seems that there is no space after *'WHERE 
CampaignStatus IN [REMOVED]',* so this could possibly be the cause of the 
error.  For your second code snippet, the syntax of setting predicates (see 
closing parenthesis and brackets) is incorrect.

You can refer to the two code snippets below (AWQL and non-AWQL) below that 
worked successfully on my end:

Using AWQL:

$reportQuery = 'SELECT AdGroupName, CampaignStatus, AdGroupStatus '
. 'FROM ADGROUP_PERFORMANCE_REPORT '
. 'WHERE CampaignStatus IN  [REMOVED] ';


Using selector:

$selector = new Selector();
$selector->setFields(['AdGroupName', 'CampaignStatus', 
'AdGroupStatus']);

$selector->setPredicates([
new Predicate('AdGroupStatus', PredicateOperator::NOT_IN, 
['REMOVED']),
new Predicate('CampaignStatus', PredicateOperator::NOT_IN, 
['REMOVED'])]);

 
Let me know if this helps.

Thanks,
Vincent
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a5d1c579-aa3e-455c-a620-404c08b64330%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread Ken Dan Tinio
Switching back to AWQL haha


This one works good for me
*WHERE AdGroupStatus NOT_IN ["REMOVED"] AND CampaignStatus NOT_IN 
["REMOVED"]*

How do you convert this into Selector Method?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4639176d-99da-4247-9616-a241ea2d8ea9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread Ken Dan Tinio
Switching back to selector, works fine:
*$selector->setPredicates([new Predicate('CampaignStatus', 
PredicateOperator::NOT_IN, ['REMOVED'])]);*

but adding another Predicate:
  *  $selector->setPredicates(*
*[new Predicate('AdGroupStatus', PredicateOperator::NOT_IN, 
['REMOVED'])], *
*[new Predicate('CampaignStatus', PredicateOperator::NOT_IN, 
['REMOVED'])]*
*);*
Doesn't work. Only the first array works fine. 

I am retrieving adgroups without removed status, but campaign status with 
removed is included.

The thing that I am trying to do is, Fetch adgroup with no removed status 
that are not associated with removed campaign. I don't want to see removed 
status.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/021d7ef1-656d-4512-9f48-c2262f7c2f64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread Ken Dan Tinio
OKay im using AWQL, works fine. BUt

*WHERE CampaignStatus != 'removed'*

gives me an error Details: [fieldPath: ; trigger: ; errorString: 
QueryError.PARSING_FAILED]


Full code of AWQL:

   * $reportQuery = 'SELECT '.$imploded_fields.' FROM 
'.self::$report_type.' '*
*. 'WHERE CampaignStatus IN [REMOVED]'*
*. 'DURING '.self::$date_range_type.'';*

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/94fbf601-2b53-45fc-9415-6cfa6f265551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
Hi Ken,

Could you confirm if you have tried filtering the AdGroupService.get() by 
CampaignStatus as I have suggested?

In regards to your latest question, you can examine first what is the 
content of the String object by the *getAsString()* method (see this line 

 on 
how to use this method). From there, you can see that the per row of data 
in your String object is separated by a new line (\n). With that in mind, 
you can check for a method in PHP that splits a String object into array 
with a new line as parameter. You can then manipulate your array of 
Strings. The data in per index in your array of Strings is the row data 
which is separated by comma (,). So in your end, you can also separate the 
per index by comma. This is just a suggestion, and you can always implement 
your own code logic that you think is better.

Thanks,
Vincent
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/097edd21-b3be-4320-a8eb-fed567f078b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread Ken Dan Tinio
I *getAsString() *method, I have already seen it. 


Thats like sounds difficult... how to do it? can you give me a term or word 
of the function for me to research about.. thanks!


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/69f2da52-145b-4984-b33e-0f3697999655%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
Hi Ken,

Upon further checking, you can filter by CampaignStatus in 
AdGroupService.get() 

 but 
you cannot get its actual value as field. You can try the code snippet 
below and let me know if this works:

$selector = new Selector();
$selector->setFields(['Id', 'Name']);
$selector->setOrdering([new OrderBy('Name', SortOrder::ASCENDING)]);
$selector->setPredicates(
[new Predicate('CampaignStatus', PredicateOperator::NOT_IN, 
['REMOVED'])]);
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));


In regards to reports, aside from generating reports in a file, you can 
only get the report data as String using *getAsString()* method. As a 
suggestion, you can use this method and do a post-processing on your end to 
transform the String object into an Array or JSON object.

Thanks,
Vincent
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/5c221696-a157-4218-a5d4-232dba5636fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread Ken Dan Tinio
I did try that. But the problem is this:

$reportDefinition->setDownloadFormat(DownloadFormat::CSV);


How do I get reports as array or json? I don't want to generate a csv.



-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/31d79d29-aff1-468a-87fd-7db7c90eb4f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get all adgroups with campaign status enable and pause?

2018-01-18 Thread 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
Hi Ken,

The CampaignStatus is not a supported field in the AdGroup 

 entity 
of AdGroupService 
.
 
If you really wish to get the ad groups from non-removed campaigns, then I 
suggest to use the Adgroup Performance Report 

 instead 
as you can filter by CampaignStatus 

 in 
this report type.

Let me know if you have further clarifications.

Thanks,
Vincent
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ad587c4b-d5b2-4914-9dcd-11cd8c35e1d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to get all adgroups with campaign status enable and pause?

2018-01-17 Thread Ken Dan Tinio
$selector = new Selector();
$selector->setFields(['Id', 'Name', 'Status', 'CampaignId', 
'CampaignName']);
$selector->setOrdering([new OrderBy('Name', SortOrder::ASCENDING)]);
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));

I have this so far. I have already retrieved all adgroups using this 
selector.

The problem is that the adgroups that I fetch includes adgroups with 
removed campaign.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/448c4c12-22cd-4be4-9a25-2deecc0b3075%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.