Google Shopping / Ad's API Help!

60 views
Skip to first unread message

ry...@n-i-e.co.uk

unread,
Feb 25, 2019, 5:24:03 PM2/25/19
to AdWords API and Google Ads API Forum

Hi, 

 

I am currently trying to work with the Google Ad's API to run Ad's on our Shopping Products. 

 

We want to use a PHP script to automatically set the Bid's each day for the products New and Refurbished depending on our stock. 

 

I have all the Keys / API Access.

 

Manual Process - Works As Required

First we add an Ad Group to our Campaign 

Then we add Sub Division's in the Ad Group for each product. 

Then we add another Sub Division for New / Refurbished on each of the product Sub Divisions. 

Now we can set Ad's max CPC for both New & Refurbished Products

 

The Problem with this

So the above allows us to setup the campaigns how we want however we have over 5,000 products and the stock changes daily so it's taking a huge amount of time to manage just a small % of our products. 

 

API Problem

We began using the Google PHP API for Adwords so that we could potentially run a script and the New / Used max CPC would changed based on stock price. 

 

However, the API creates the Ad Group and then I can create the Sub Divisions but where in Google Adwords we could manually set the divisions the Google API is only allowing us to create a division based on the product brand. 

 

Here is the code where it creates the Product Division / Partition <- Bit confusing as Adwords calls them Sub Divisions and API uses Product Partitions.

 

$operation = ProductPartitions::createAddOperation($criterion);
        $operations[] = $operation;  

		$otherCondition = ProductPartitions::createSubdivision(
            $root,
            new ProductCanonicalCondition()
        );
        $criterion = ProductPartitions::asBiddableAdGroupCriterion(
            $adGroupId,
            $otherCondition
        );
        $operation = ProductPartitions::createAddOperation($criterion);
        $operations[] = $operation;
		 
		  
        $coolBrand = new ProductBrand();
        $coolBrand->setValue('Product Brand'); ///WE WANT PRODUCT ID HERE NOT BRAND
        $coolBrandUnit = ProductPartitions::createUnit($otherCondition, $coolBrand);
        $criterion = ProductPartitions::asBiddableAdGroupCriterion(
            $adGroupId,
            $coolBrandUnit,
            900000
        );
        $operation = ProductPartitions::createAddOperation($criterion);
        $operations[] = $operation;


Is there anybody that could help or provide me with some better documentation. Currently I have been using the below links and still can't figure it out. 

 

https://developers.google.com/adwords/api/docs/samples/php/shopping-campaigns#build-a-product-partit...

https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupCriterionService.ProductDime...

 

Thank you, any help is appreciated. 

googleadsapi...@google.com

unread,
Feb 26, 2019, 2:01:12 AM2/26/19
to adwor...@googlegroups.com
Hi Ryan,

If you want to specify the Id then I would recommend that you use ProductOfferId instead of the ProductBrand dimension. Please note, however, that the ProductOfferId is currently not supported in Smart Shopping Campaigns.

For more information on shopping campaigns and partitioning, you may refer to this guide. Let me know if this is what you're looking for.

Thanks and regards,
Peter
AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@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 and Google Ads 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/bbbc5f66-1d9f-4a36-9b05-febbbbb49278%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ry...@n-i-e.co.uk

unread,
Feb 26, 2019, 2:37:56 AM2/26/19
to AdWords API and Google Ads API Forum
@googleadsapi-forumadvisor, Thank you :) that worked perfectly, I now call the ProductOfferId instead of the ProductBrand dimension. 
Reply all
Reply to author
Forward
0 new messages