Fetching campaigns with explicit experiment type vs using IN operator returns different results

24 views
Skip to first unread message

Andjel Boskovic

unread,
Dec 1, 2021, 3:21:29 AM12/1/21
to AdWords API and Google Ads API Forum
Hi,

When I fetch campaigns with the following request:
```
$experimentTypes = ['BASE', 'EXPERIMENT', 'UNKNOWN'];
  foreach ($experimentTypes as $experimentType) {
    $query = "SELECT
    campaign.id,
    campaign.advertising_channel_type,
    campaign.start_date,
    campaign.end_date,
    campaign.serving_status,
    campaign.status,
    campaign.name,
    campaign.experiment_type
    FROM campaign
    WHERE
    campaign.experiment_type = '{$experimentType}'"
    campaigns = [];
    foreach (
      $this->googleAdsServiceClient->searchStream($account, $query)->iterateAllElements() as $googleAdsRow) {
              $campaigns[] = $googleAdsRow->getCampaign()
            }
    }
count($campaigns)
```

I get more campaigns returned than when I fetch with this request:

```
    $query = "SELECT
    campaign.id,
    campaign.advertising_channel_type,
    campaign.start_date,
    campaign.end_date,
    campaign.serving_status,
    campaign.status,
    campaign.name,
    campaign.experiment_type
    FROM campaign
    WHERE
    campaign.experiment_type IN('BASE', 'EXPERIMENT', 'UNKNOWN')
    campaigns = [];
    foreach (
      $this->googleAdsServiceClient->searchStream($account, $query)->iterateAllElements() as $googleAdsRow) {
              $campaigns[] = $googleAdsRow->getCampaign()
            }
count($campaigns)
```

As far as I can tell the missing campaigns with the second request are mostly of type EXPERIMENT.

Could there be something wrong with the way IN operator is being evaluated on your side? Or am I missing something here?

Google Ads API Forum Advisor

unread,
Dec 2, 2021, 5:01:03 AM12/2/21
to andjel....@fishingbooker.com, adwor...@googlegroups.com
Hi Andjel,

Thank you for posting your concern.

To investigate, could you provide the complete request and response logs with request ID and request header generated on your end? Please also provide the campaign IDs of experiment campaigns that you are expecting to show but not included in the report.

You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RxeWU:ref
Reply all
Reply to author
Forward
0 new messages