Help Needed: Script to Export Exact Campaign Keywords to Google Sheets (Not Search Terms)

29 views
Skip to first unread message

Daniel Cosci

unread,
Jun 6, 2025, 9:44:33 AM (5 days ago) Jun 6
to Google Ads Scripts Forum

Hi,

I’m reaching out for support with a Google Ads Script I’ve been trying to use to automatically export monthly keyword performance data from a specific campaign into a Google Sheet.

I'm not a developer, and I've created the script with help from ChatGPT, but I'm having trouble getting it to work as expected.


🔧 What I'm trying to achieve:
  • Export only the keywords I have manually added in the campaign, including their correct match types (e.g. [keyword], "keyword", keyword) — not the search terms or matched variants.

  • Structure the export month by month, one row per keyword per month.

  • Make it work retroactively, starting from the campaign launch in January 2024.

  • Have it automatically update each month, appending new data without duplicating previous entries.

Here is the Google Sheet where I want to collect this data:
🔗 My sheet model


🆘 The issues I'm facing:
  1. The script seems to include search terms or variant queries, not the exact keywords as set in the campaign.

  2. I can’t figure out how to make the script retrieve historical data by month since the campaign started.

  3. I’d like the process to run monthly and automatically, updating the sheet without re-writing or duplicating rows.

I would really appreciate your help in understanding how to achieve this — or if you could point me to a template/script that already solves this problem.

Thanks so much in advance,

Google Ads Scripts Forum Advisor

unread,
Jun 6, 2025, 2:18:13 PM (4 days ago) Jun 6
to adwords...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads Scripts Support team.

I would like to inform you that we cannot provide support for any third party scripts and we can assist only on the technical queries/concerns related to Google Ads Scripts.
  • The script seems to include search terms or variant queries, not the exact keywords as set in the campaign.
           I would suggest you to refer to the guide and sample examples of the keywords which can help you to fetch all the exact keywords
           associated with your campaigns and in order to get the required metrics associated to the keyword, you can refer to stats documentation
           for more information.
  • I can’t figure out how to make the script retrieve historical data by month since the campaign started.
          You can retrieve the historical data based by setting up the date range in the script based on the campaign and we don't have any specific
           method to fetch the data directly from the last campaign started.
  • I’d like the process to run monthly and automatically, updating the sheet without re-writing or duplicating rows.
          You can set the frequency of the script to execute for every month and you can refer to the available spreadsheet methods that can support
          Google Ads Scripts. If you need further assistance on the Spreadsheet related queries, you can reach out to the App scripts team as they
          are better equipped to address your concern.

Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-06-06 13:17:25Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01reTph:ref" (ADR-00310587)



Reply all
Reply to author
Forward
0 new messages