How to avoid duplicates while making bulk imports scripts from Google Sheets

104 views
Skip to first unread message

Antoine Bezy

unread,
Jun 17, 2020, 10:20:37 AM6/17/20
to Google Ads Scripts Forum
Hello,

I am using a script to periodically call a Google sheets to import new Ads and make changes in existing Ads.
It works fine for creating Ads but when I try to make changes it creates a new add every time.

The only thing I am changing is the 'Headline 2' column, everything else stays the say.
Does anyone has any idea how to avoid duplicates ?

Here is my script, I am pretty new to this so sorry if this is obvious :)

function main() {
  var ss = SpreadsheetApp.openByUrl(ssUrl).getActiveSheet();
  var data = AdsApp.bulkUploads().newFileUpload(ss);
  data.apply()
}


Thank you for you help.

Antoine

Google Ads Scripts Forum Advisor

unread,
Jun 17, 2020, 1:44:40 PM6/17/20
to adwords-scripts+apn2wqc8dm45tuyx...@googlegroups.com, adwords-scripts+apn2wqc8dm45tuyx...@googlegroups.co, adwords...@googlegroups.com
Hi Antoine,

As you can see in this bulk upload guide, ad properties cannot be modified except for status and device preference. 

Please let us know if you have any other questions.

Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5004Q217Akf:ref

Antoine Bezy

unread,
Jun 17, 2020, 6:06:57 PM6/17/20
to Google Ads Scripts Forum
Hello,

Thank you for your answer !

Is there anyway to create and modify Google Ads from Google sheets then ?

Google Ads Scripts Forum Advisor

unread,
Jun 17, 2020, 10:15:16 PM6/17/20
to adwords...@googlegroups.com
Hi Antoine,

Could you confirm if my understanding is correct that you want to use the custom function of Google spreadsheet to modify Google Ads entities? If yes, then I am afraid that this is not possible.

You can use Google ads scripts instead to manage Google Ads entities but this could only be used in script editor (TOOLS & SETTINGS > BULK ACTIONS > Scripts).

Hope this helps.

Regards,
Ejay

Antoine Bezy

unread,
Jun 25, 2020, 11:16:10 AM6/25/20
to Google Ads Scripts Forum
Hi,

Thank you for your answer.

I am importing Ads groups and Ads everyday and would like the already existing Ads not to be duplicated. And the one in my file which does not exist to be created.
Also, I would like 'Headline 2' to be updated if it is different in the file than in the existing Ads. The headline 2 contains the price of the product, this is why it needs to be updated.

I am using Google script to import the Ads and groups from the Google sheets.
If this is not the appropriate way to do it could you tell me more about the good way ?

Thanks.
Antoine

Google Ads Scripts Forum Advisor

unread,
Jun 25, 2020, 3:44:03 PM6/25/20
to adwords-scripts+apn2wqc8dm45tuyx...@googlegroups.com, adwords-scripts+apn2wqc8dm45tuyx...@googlegroups.co, adwords...@googlegroups.com
Hi Antoine,

Are you using bulk uploads from scripts? There is not a way for Ads to detect your bulk upload as a duplicate entity, since it will create duplicates, as you've seen. The best way to deal with this is to manage the spreadsheet. For instance, you could download entities from the UI and identify unique rows in your upload sheet to ensure no duplicates are uploaded. 

Regarding the headline 2 change, as mentioned earlier in the thread, ads cannot be modified once they are created except for status and device preference.

Regards,
Matt
Reply all
Reply to author
Forward
0 new messages