Bulk Uploads - Target CPA on ad-groups not supported/buggy?

121 views
Skip to first unread message

Mikael

unread,
Jan 7, 2020, 10:18:15 AM1/7/20
to Google Ads Scripts Forum

Hi, 

Summary
The bulk upload docs for for G.Ads Scripts only documents the "Max. CPA (converted clicks)" for CPA bid strategies. This seems antiquated and should probably be updated to support "Target CPA" as "Max. CPA (converted clicks)" bulk uploads seems to be a NOP (at least for for standard AdGroups with Target CPA settings on the campaign level).

Details
When trying to use the field "Target CPA" on an adgroup level (using scripts) i'm left with the error 
"Unable to determine the entity-type of this row. Make sure to only provide fields for columns that are appropriate for the entity."
"Target CPA" field works just fine with manual bulk uploads (through the UI)

Example
(the Campaign c1 have been created with "Bidding: Target CPA ...." settings on the campaign level.)

Simplified example code:
var bulker = AdsApp.bulkUploads().newCsvUpload([
   
'Action',
   
'Campaign',
   
'Ad group', 'Ad group state', 'Bid strategy type', 'Target CPA',
], { moneyInMicros: false });

bulker
.append(
 
{"Action":"set","Campaign":"c1","Ad group":"a1","Target CPA":Math.random(),"Bid strategy type":"Target CPA"}
)

bulker.apply()
Fails with "Unable to determine the entity-type...". This same upload (done manually though UI) works fine 

While 
var bulker = AdsApp.bulkUploads().newCsvUpload([
   
'Action',
   
'Campaign',
   
'Ad group', 'Ad group state', 'Bid strategy type', 'Max. CPA (converted clicks)',
], { moneyInMicros: false });

bulker
.append(
 
{"Action":"set","Campaign":"c1","Ad group":"a1","Target CPA":Math.random(),"Bid strategy type":"Max. CPA (converted clicks)"}
)

bulker.apply()
"succeeds" with "#No change"

As far as i can tell there is no way to set the Target CPA through bulk-uploads using google scripts, I'm i wrong and if I'm not, will this be supported/fixed?

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Jan 7, 2020, 2:52:50 PM1/7/20
to adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.com, adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.co, adwords...@googlegroups.com
Hi Mikael,

In your code, the columns set by the newCsvUpload method do not match the key-value pairs given in the appended rows. In your append method, you have 'Target CPA' as a column (a key), which is not a supported column.

I ran your second block of code, but I receive the error:
 
The value 'Max. CPA (converted clicks)' in column 'Bid strategy type' is invalid.
 
' Max. CPA (converted clicks)' is not a valid row value for bidding strategy type, however, it is a valid and required column when the bidding strategy type is set to 'cpa'.

You may try this code instead:

  var bulker = AdsApp.bulkUploads().newCsvUpload([

    'Campaign',
    'Ad group', 'Ad group state', 'Bid strategy type', 'Max. CPA (converted clicks)',
  ], { moneyInMicros: false });

  bulker.append(
    {"Campaign":"c2","Ad group":"a2", "Bid strategy type":"Target CPA", "Max. CPA (converted clicks)":"2"} //edit the Max. CPA number
  )

  bulker.apply();

Regards,
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5001UOGBuU:ref

Mikael

unread,
Jan 7, 2020, 3:56:37 PM1/7/20
to Google Ads Scripts Forum
Hi Matt, 

Thanks for your quick reply; the issue you refer to was only a copy-paste issue on my end, sorry for this. After correcting the field names to match your proposal the issue still exhibits the NOP / "No changes" result no matter the value I pick for the CPA number (exemplified by using Math.random() in the previews example). Inputting the CPA as of string or float doesn't change this NOP outcome.

Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Jan 8, 2020, 2:43:26 PM1/8/20
to adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.com, adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.co, adwords...@googlegroups.com
Hi Mikael,

Are you looking in the uploads history or the scripts history? If you do not see changes in the upload history, can you please provide your CID?

Thanks,
Message has been deleted

Google Ads Scripts Forum Advisor

unread,
Jan 9, 2020, 12:17:10 PM1/9/20
to adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.com, adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.co, adwords...@googlegroups.com
Hi Mikael,

The bulk upload wasn't able to infer that the CPA should be changed -- the 'action' column needs to be explicit in this case. It inferred that we were trying to add an ad group instead of make a bid change. Add the column 'Action', and then for the 'change' variable, add the row:

      "Action": "set"

Regards,

Mikael

unread,
Jan 9, 2020, 5:19:34 PM1/9/20
to Google Ads Scripts Forum
Having the "Action": "set" provided only affects the printout of the bulk upload status; it does not change the adgroup target CPA. The bulk upload "succeeds" with the text "1 successful change" but have "--" as the change description. The actual target CPA on the AdGroup remains unchanged.

Trying to use the same fields on on campaign level does nothing; but providing "Target CPA": 1.23 on campaign levels.

Basically. 
function main() {
  // Works on campaign level (note that Target CPA is undocumented @ https://developers.google.com/google-ads/scripts/docs/features/bulk-upload-entities)
  Bulk("Campaign level Target CPA working",{
    "Action": "set", 
    "Campaign":"some campaign",
    "Bid strategy type":"Target CPA", 
    "Target CPA": 1.23
  })
  
  // Prints success in bulk upload but is a NOP and doesn't change the target cpa on the adgroup
  Bulk("Succeeds but does nothing", {
    "Action": "set", 
    "Campaign":"some campaign",
    "Ad group":"some adgroup", 
    "Bid strategy type":"Target CPA", 
    "Max. CPA (converted clicks)":Math.random() // to ensure we always get a "new" CPA value which should trigger an update
  })
  
  // Trying to use "Target CPA" field with "Ad group" set fails with:
  // Unable to determine the entity-type of this row. Make sure to only provide fields for columns that are appropriate for the entity.
  Bulk("Fails with unable to determine", {
    "Action": "set", 
    "Campaign":"some campaign",
    "Ad group":"some adgroup", 
    "Bid strategy type":"Target CPA", 
    "Target CPA":Math.random() // to ensure we always get a "new" CPA value which should trigger an update
  })
  
}

function Bulk(name, data){
  var bulker = AdsApp.bulkUploads().newCsvUpload(Object.keys(data), { moneyInMicros: false });
  Logger.log(data)
  bulker.setFileName(name)
  bulker.append(data)
  bulker.apply();
}

Google Ads Scripts Forum Advisor

unread,
Jan 10, 2020, 3:39:46 PM1/10/20
to adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.com, adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.co, adwords...@googlegroups.com
Hi Mikael,

I've reported this behavior and the lack of documentation to our team -- when I have more information on this, I'll provide an update here.

Thanks,

Mikael

unread,
Feb 7, 2020, 5:03:24 AM2/7/20
to Google Ads Scripts Forum
Hi, 

Any updates here? 

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Feb 7, 2020, 2:51:30 PM2/7/20
to adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.com, adwords-scripts+apn2wqeap1qv7pg7...@googlegroups.co, adwords...@googlegroups.com
Hi Mikael,

This is still being looked into. I've reached out, however, and I will provide more information here as soon as possible.

Mikael

unread,
Mar 10, 2020, 6:08:28 PM3/10/20
to Google Ads Scripts Forum
Hi, 

Just a monthly check-in if anything have moved in this area? 

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Mar 10, 2020, 10:59:55 PM3/10/20
to adwords...@googlegroups.com
Hi Mikael,

My apologies for the inconvenience.

If you are looking for some updates about the issue, then, I am afraid that our team is currently working on the fix. However, let me followup the team for any updates. I will let you know as soon as I receive some information.

Regards,
Ejay

Mikael

unread,
Oct 5, 2020, 9:28:54 AM10/5/20
to Google Ads Scripts Forum
Hi, 

Checking in this item again to see if there has been any progress? 

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Oct 5, 2020, 10:23:27 PM10/5/20
to adwords...@googlegroups.com

Hi Mikael,

Thanks for your patience on this. I'm afraid that there is currently no update on this. However, I've already made a follow up with the team.

As an aside, have you tried the workaround mentioned by my colleague (Peter) on the previous response?

"Usually the right way to ensure the correct formatting of a bulk upload is actually to perform a download from the UI to see what columns you can get and what they're called. Modifying values from the downloaded report and then re-uploading it should generally result in a correctly formatted bulk upload."

Regards,

Google Logo
Mark Kevin Albios
Google Ads Scripts Team
 


ref:_00D1U1174p._5001UOGBuU:ref

Mikael

unread,
Oct 6, 2020, 6:28:33 PM10/6/20
to Google Ads Scripts Forum
Hi Mark, 

As per my first example (which I believe was derived from exactly this approach) works when I'm using the web-UI but the same content uploaded through a script fails. Given that the UI accepts it it should be the correct column naming(no?). 

There seems to be some extra checks in the scripts versions that blocks newer bulk-upload features/behaviors. 

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Oct 6, 2020, 10:41:27 PM10/6/20
to adwords...@googlegroups.com

Hi Mikael,

Thanks for getting back to us.

Allow me to relay your message with the team. We'll be updating this thread for any feedbacks available.

Regards,

Google Ads Scripts Forum Advisor

unread,
Jan 7, 2021, 2:11:45 AM1/7/21
to adwords...@googlegroups.com

Hi Mikael,

 

I am Harry from the Google Ads Scripts Team. I am writing to inform you that bulk uploading Target CPA for Ad Groups should be working as expected by now. Let me know if there are still issues.

 

Thanks,

Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5001UOGBuU:ref

Mikael

unread,
Jan 7, 2021, 3:26:40 PM1/7/21
to Google Ads Scripts Forum
Hi Harry, 

Thanks for looking into this! Would i be possible to update the documentation with an example of how it is intended to work? I know last time I tried there was a lot of guess work before filing this bug. Would be great to have a reference snippet to fall back on! 

Either way, thanks!

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Jan 7, 2021, 9:58:21 PM1/7/21
to adwords...@googlegroups.com

Hi Mikael,

 

Thanks for getting back. You can check out the code snippets on this link regarding the Bulk Upload function via Google Ads Scripts. Let me know if you have other concerns.

Mikael

unread,
Jan 8, 2021, 3:42:03 AM1/8/21
to Google Ads Scripts Forum
Hi, 

Neither of the examples covers how to set CPA which as been a problematic item in the past. But i take it this is a low priority. 

Best Regards
Mikael

Google Ads Scripts Forum Advisor

unread,
Jan 8, 2021, 5:15:45 AM1/8/21
to adwords...@googlegroups.com

Hi Mikael,

 

I'll pass this on to the rest of the team for consideration and get back to you once I have any updates regarding your request. Please be informed that there is no guarantee that this will be added to the Google Ads Scripts documentation anytime soon.

Reply all
Reply to author
Forward
0 new messages