Hello,

Sorry if this has been covered, or if I have made a silly error... 

I am trying to use the AdGroupAdService to find the Final / Destination 
URLs for the ads we manage (there are about 6000 or so). 
This part seems okay. But I want to only deal with our ads that are active, 
so i have been looking at the status field to see which are set to 
"ENABLED". 
But often ads that are paused, or are within a campaign that is paused, or 
even in an account that is deactivated return with a status of ENABLED. 

Is that expected behaviour, or have I made an error? 

Thanks!
James


<?php

require_once '/apimaster/examples/AdWords/v201506/init.php';

$user = new AdWordsUser();
$account = '{account number removed}';

$user->SetClientCustomerId($account);

$adGroupAdService = $user->GetService('AdGroupAdService', ADWORDS_VERSION);

$selector = new Selector();
$selector->fields = array('CreativeFinalUrls', 'Status');

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

$page = $adGroupAdService->get($selector);

if(!empty($page->entries)) {
    foreach ($page->entries as $adgroup) {

        $adgroupid      =   $adgroup->adGroupId;
        $status =           $adgroup->status;
        $headline       =   $adgroup->ad->headline;
        $description1   =   $adgroup->ad->description1;
        $description2   =   $adgroup->ad->description2;
        $normalurl      =   $adgroup->ad->url;
        $finalurl       =   $adgroup->ad->finalUrls;
        $displayurl     =   $adgroup->ad->displayUrl;
        $id =               $adgroup->ad->id;
     
        if ($status === "ENABLED") { 

        [...]


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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/e5a5a191-5b6a-4d7c-a642-7cf5f11c39b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to