Tuesday, 26 July 2016

Re: Adwords remarketing type (PHP)

Hello, of course it's not work :(

 
On the image I try to show you setup whose I need.
Also It's my code:



$campaignId = '632489937';
function AddAdGroupsExample(AdWordsUser $user, $campaignId) {
 
// Get the service, which loads the required classes.
  $adGroupService
= $user->GetService('AdGroupService', ADWORDS_VERSION);


  $numAdGroups
= 2;
  $operations
= array();
 
for ($i = 0; $i < $numAdGroups; $i++) {
   
// Create ad group.
    $adGroup
= new AdGroup();
    $adGroup
->campaignId = $campaignId;
    $adGroup
->name = 'Earth to Mars Cruise #' . uniqid();


   
// Set bids (required).
    $bid
= new CpcBid();
    $bid
->bid =  new Money(1000000);
    $biddingStrategyConfiguration
= new BiddingStrategyConfiguration();
    $biddingStrategyConfiguration
->bids[] = $bid;
    $adGroup
->biddingStrategyConfiguration = $biddingStrategyConfiguration;


   
// Set additional settings (optional).
    $adGroup
->status = 'ENABLED';


   
// Targeting restriction settings. Depending on the criterionTypeGroup
   
// value, most TargetingSettingDetail only affect Display campaigns.
   
// However, the USER_INTEREST_AND_LIST value works for RLSA campaigns -
   
// Search campaigns targeting using a remarketing list.
    $targetingSetting
= new TargetingSetting();
   
// Restricting to serve ads that match your ad group placements.
   
// This is equivalent to choosing "Target and bid" in the UI.
    $targetingSetting
->details[] =
       
new TargetingSettingDetail('USER_INTEREST_AND_LIST', true);
   
// Using your ad group verticals only for bidding. This is equivalent
   
// to choosing "Bid only" in the UI.
   
// $targetingSetting->details[] =
   
//     new TargetingSettingDetail('VERTICAL', true);
    $adGroup
->settings[] = $targetingSetting;


   
// Create operation.
    $operation
= new AdGroupOperation();
    $operation
->operand = $adGroup;
    $operation
->operator = 'ADD';
    $operations
[] = $operation;


  $adGroupCriterionService
= $user->GetService('AdGroupCriterionService', ADWORDS_VERSION);


   
// Create biddable ad group criterion.
    $adGroupCriterion
= new BiddableAdGroupCriterion();
    $adGroupCriterion
->adGroupId = $adGroup;
    $adGroupCriterion
->criterion->CriterionUserList->userListId="404270416";




 
}


 
// Make the mutate request.
  $result
= $adGroupService->mutate($operations);


 
// Display result.
  $adGroups
= $result->value;
 
foreach ($adGroups as $adGroup) {
    printf
("Ad group with name '%s' and ID '%s' was added.\n", $adGroup->name,
        $adGroup
->id);
 
}
}

I need to code kept the same as the setting in the picture, I hope that now it is easier to understand me :)

W dniu wtorek, 26 lipca 2016 04:57:34 UTC+2 użytkownik Joyce Lava napisał:
Hi,

Apologies for the delayed response. Please see the answers in blue:

How to set Target setting on Interests & remarketing?
      Use the AdGroupService to create the TargetingSettingDetail and set it as the settings (TargetingSetting) of the adGroup. The TargetingSettingDetail should have criterionTypeGroup = USER_INTEREST_AND_LIST and targetAll (true for "Bid only" or false for "Target and bid"). 
How to set  Interests & remarketing "category" on customer email list?
      Apologies but I'm not sure if I understand the question correctly. Could you please elaborate what you need to do on this question? Are you referring to create a ConversionTracker with category REMARKETING? If not, please provide more details on what needs to be done in this concern to properly answer it.
How to save customer email list as targeting?
      Use the AdGroupCriterionService to add each userList as an AdGroupCriterion with criterion of type CriterionUserList. You may refer to the AddKeywords.php to check how to create the BiddableAdGroupCriterion. Just replace the Keyword object with the CriterionUserList object.

Hope this helps.

Best Regards,
Joyce, 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+unsubscribe@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+unsubscribe@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/bc1ed4de-9897-4ceb-b899-28956ffae9ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment