Uniqueness of CampaignName

21 views
Skip to first unread message

Mark Hansen

unread,
Jan 13, 2016, 11:14:46 AM1/13/16
to AdWords API Forum
Is the field CampaignName (https://developers.google.com/adwords/api/docs/appendix/reports/campaign-performance-report#campaignname) in the Campaign Performance Report unique?

Specifically, can I use it in a query to uniquely identify a campaign, or might I get more than one result back?

Finally, how can I tell from the documentation whether or no a report field is a unique identifier?

Thanks,

Mark

Anthony Madrigal

unread,
Jan 13, 2016, 11:39:00 AM1/13/16
to AdWords API Forum
Hi Mark,

Campaign names are unique to the account, so when querying campaign names, you should only get 1 campaign returned. As far as I know, there is no documentation stating what fields are unique or not.

Cheers,
Anthony
AdWords API Team

Alan Coleman

unread,
Jan 13, 2016, 11:57:14 AM1/13/16
to AdWords API Forum
Hi Mark,

You'd probably be better off identifying a Campaign by its ID, then there's no ambiguity. Also, if your campaign name changes in the GUI, any AdWords application that uses that name probably will cease to identify it.

Shown here in the Campaign Remove example.

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

  // Create campaign with REMOVED status.
  $campaign = new Campaign();
  $campaign->id = $campaignId;
  $campaign->status = 'REMOVED';
```

Thanks
Reply all
Reply to author
Forward
0 new messages