Shopping Ads script

25 views
Skip to first unread message

Ionut Fratila

unread,
Jun 26, 2023, 2:07:50 PM6/26/23
to Google Ads API and AdWords API Forum
Hi,

I'm trying to write a small script for my Google Shopping Ads campaigns so that when a product group gets 100 clicks and its conversion value is 0, it will be excluded.

I'm a newbie to programming and I'm having trouble with the second condition: conversion value < 0, because I haven't found a method available to retrieve values like conversion value, conversion or cost at the Product Groups level.

Can someone help me find a method?

Here is the code, but only with the first condition:
function main()
{
    const productGroups = AdsApp.productGroups()
        .withCondition("metrics.clicks > 100")
        .Achieve();
    for (const productGroup of productGroups)
    {
        productGroup.exclude();
    }
}

Thank you!

Google Ads API Forum Advisor

unread,
Jun 27, 2023, 5:00:15 AM6/27/23
to sup...@flashx.ro, adwor...@googlegroups.com

Hi Ionut,

 

Thank you for reaching out to the Google Ads API Forum Channel.

 

Upon checking, it appears that the code you're provided is created via Google Ads Scripts <https://developers.google.com/google-ads/scripts/docs/start>. Please do note that this forum channel only provides support to the Google Ads API <https://developers.google.com/google-ads/api/docs/start>. I'm afraid we would be unable to further comment on the tool used as it is already outside our scope of support. We would instead recommend you reach out to their support team via posting on their public forum for further assistance: https://groups.google.com/g/adwords-scripts.

 

If you'd need any assistance regarding the Google Ads API, then you may always come back to us.

 

This message is in relation to case "ref:_00D1U1174p._5004Q2mXh3Y:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages