CampaignService with AdvertisingChannelType

141 views
Skip to first unread message

etienne....@admobio.com

unread,
Nov 19, 2015, 9:13:39 AM11/19/15
to AdWords API Forum
Hi,

We are programming a web application that must determine whether the campaigns of a customer display on both network at the same time (Search and Display) which is not optimal.

There is something I can not understand ... We have campaigns that appear on both networks at once.

The problem is that the following code display only one of the two networks, even if the campaign is available on two networks.

Do you have an idea ?

Thank you !

Code:
function getCampaign(AdWordsUser $user) {
 $campaignService
= $user->GetService('CampaignService', ADWORDS_VERSION);
 $selector
= new Selector();
 $selector
->fields = array('Id','Name', 'Status', 'AdvertisingChannelType');
 
// Filter out deleted criteria.
       
//$selector->predicates[] = new Predicate('Status', 'NOT_IN', array('DELETED', 'PAUSED'));
 
 $page
= $campaignService->get($selector);


 
print_r("<pre>");
 print_r
($page->entries);
 print_r
("</pre>");
}


Result: (This campaign is on both networks but displays only one)
[0] => Campaign Object
       
(
           
[id] => 9806xxxx
           
[name] => xxxxxxx
           
[status] => ENABLED
           
[servingStatus] =>
           
[startDate] =>
           
[endDate] =>
           
[budget] =>
           
[conversionOptimizerEligibility] =>
           
[adServingOptimizationStatus] =>
           
[frequencyCap] =>
           
[settings] =>
           
[advertisingChannelType] => SEARCH
           
[advertisingChannelSubType] =>
           
[networkSetting] =>
           
[labels] =>
           
[biddingStrategyConfiguration] =>
           
[forwardCompatibilityMap] =>
           
[trackingUrlTemplate] =>
           
[urlCustomParameters] =>
       
)


Anthony Madrigal

unread,
Nov 19, 2015, 4:05:57 PM11/19/15
to AdWords API Forum
Hi,

The campaign's AdvertisingChannelType for Search Network with Display Select is Search. In order to differentiate whether or not it is only a search network or search and display network, use the fields targetSearchNetwork and targetContentNetwork in the NetworkSetting. These are boolean values and should both be set to true if they fit this network type.

Cheers,
Anthony
AdWords API Team
Message has been deleted
Message has been deleted

etienne....@admobio.com

unread,
Nov 20, 2015, 11:37:46 AM11/20/15
to AdWords API Forum
Hi,

Ok so I was finally able to retrieve the Boolean value of each network.

I add my piece of code if it can help someone else.

Thank you !

//Definition

//Ads will be served with Google.com search results
//targetGoogleSearch

//Ads will be served on partner sites in the Google Search Network
//targetSearchNetwork

//Ads will be served on specified placements in the Google Display Network
//targetContentNetwork

//Ads will be served on the Google Partner Network
//targetPartnerSearchNetwork

$x
= $user->GetService('CampaignService', ADWORDS_VERSION);

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

 
'TargetGoogleSearch',
 
'TargetSearchNetwork',
 
'TargetContentNetwork',
 
'TargetPartnerSearchNetwork'
);

$campaign
= $x->get($selector);

print_r
("<pre>");
print_r
($campaign->entries);
print_r
("</pre>");

//Or you can get value with for each
foreach ($campaign->entries as $result) {
  printf
("<strong>Id:</strong> %s<br>", $result->id);
  printf
("<strong>Name:</strong> %s<br>", $result->name);
  printf
("<strong>Status:</strong> %s<br>", $result->status);
  printf
("<strong>Google.com search results:</strong> %s<br>", $result->networkSetting->targetGoogleSearch);
}

Christophe Agoero

unread,
Mar 10, 2016, 8:18:52 AM3/10/16
to AdWords API Forum
Hi,
it's  possible to have this differrence in campaign performance report because when my campaign is search  without  display or search with display is the same row
The field with boolean value targetContentNetwork doesn't exit
With the field AdvertisingChannelType,AdNetworkType1,AdNetworkType2 the same number of row is return.
Thank you
Reply all
Reply to author
Forward
0 new messages