Smart Campaign: Keyword Themes

350 views
Skip to first unread message

Kevin

unread,
Jul 12, 2021, 5:43:17 PM7/12/21
to AdWords API and Google Ads API Forum
Hi,

I love that Smart Campaign data is going to be available from the API but have been having some issues getting the Keyword theme data. It is available according to the Documentation and Query Validator:
However, when I make the request I get an Internal Error.

For a minimal reproduction, when I try:
SELECT campaign_criterion.type, campaign_criterion.status, campaign_criterion.criterion_id, campaign_criterion.keyword_theme.keyword_theme_constant FROM campaign_criterion WHERE campaign_criterion.type = 'KEYWORD_THEME' LIMIT 1000
I get 8 results, which matches the UI.

But when I add the keyword constant (or any of the keyword constant related fields):
SELECT campaign_criterion.type, campaign_criterion.status, campaign_criterion.criterion_id, campaign_criterion.keyword_theme.keyword_theme_constant, campaign_criterion.keyword_theme.free_form_keyword_theme FROM campaign_criterion WHERE campaign_criterion.type = 'KEYWORD_THEME' LIMIT 1000
I get an internal error:
{
  "StatusCode": 13,
  "Details": "Internal error encountered.",
  "RequestId": "pzk_nc5FCt-JBuizgrZ0XQ",
  "Failure": {
    "requestId": "pzk_nc5FCt-JBuizgrZ0XQ"
  }
}

Another example,
SELECT campaign_criterion.type, campaign_criterion.status, campaign_criterion.criterion_id, campaign_criterion.keyword_theme.keyword_theme_constant, keyword_theme_constant.country_code FROM campaign_criterion WHERE campaign_criterion.type = 'KEYWORD_THEME' LIMIT 1000
Also gives:
{
  "StatusCode": 13,
  "Details": "Internal error encountered.",
  "RequestId": "bPF8g8L0KtoMlsmNN0L6PQ",
  "Failure": {
    "errors": [
      {
        "errorCode": {
          "internalError": "INTERNAL_ERROR"
        },
        "message": "An internal error has occurred."
      }
    ],
    "requestId": "bPF8g8L0KtoMlsmNN0L6PQ"
  }
}

I believe each query is valid (according to the validator), and this reproduces repeatedly so I do not think it is a transient internal error.

Is anyone else encountering this issue? It's a real blocker for any Smart Campaign usage.

Thanks,
Kevin

Google Ads API Forum Advisor

unread,
Jul 14, 2021, 9:55:21 AM7/14/21
to lopsid...@gmail.com, adwor...@googlegroups.com
Hi Kevin,

Thanks for notifying us about this. Please allow me to share this with our team and we will provide an update shortly.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2KbhQP:ref

Google Ads API Forum Advisor

unread,
Jul 14, 2021, 8:17:08 PM7/14/21
to lopsid...@gmail.com, adwor...@googlegroups.com
Hello Kevin,

I was able to reproduce what you're seeing, and I'm surprised by the error as well because I even narrowed it down to one criterion that for sure has a keyword constant theme. That still fails with a similar error to yours. I've started a chat with my fellow engineers who worked on that piece of code to find out why this is happening. They are already offline for the day, so I'm waiting to hear back from them.

Feel free to reply on this thread if you don't hear form me soon.

Best,
Nadine Wang, Google Ads API Team

ref:_00D1U1174p._5004Q2KbhQP:ref

Kevin

unread,
Jul 20, 2021, 3:22:26 PM7/20/21
to AdWords API and Google Ads API Forum
Hi Nadine,

It's been around a week and I was wondering if there were any updates on this topic.

Thanks,
Kevin

Google Ads API Forum Advisor

unread,
Jul 20, 2021, 5:56:57 PM7/20/21
to lopsid...@gmail.com, adwor...@googlegroups.com
Hi Kevin,

Thanks for checking in. The API is so big that I was on a bit of a quest to find the person who wrote this specific piece of code. I did indeed find the person who coded this part of the API, and I started chatting with him today. He's taking a look to find out why the query is behaving in this way. I'll get back to you when he's finished his initial look.

Cheers,
Nadine, Google Ads API Team 

ref:_00D1U1174p._5004Q2KbhQP:ref

Google Ads API Forum Advisor

unread,
Jul 22, 2021, 5:14:49 PM7/22/21
to lopsid...@gmail.com, adwor...@googlegroups.com
Hello Kevin,

This is an odd one. It turns out it's a limitation of keyword theme constant right now where we can only return one filtered keyword theme constant at a time.

If you do this query, you'll get an internal error as well:

SELECT keyword_theme_constant.resource_name FROM keyword_theme_constant

However, if you do this query with a filter on the resource name, then you'll get back a result:

SELECT keyword_theme_constant.resource_name FROM keyword_theme_constant WHERE keyword_theme_constant.resource_name = 'keywordThemeConstants/325198~0'

As a result of this behavior, when you make a call to the other resource along with this resource, an error happens since it can only retrieve one at a time right now. 

I'm now checking to see if it's feasible to make it where more than one keyword theme constant can be retrieved at a time. If not, then there should be a clear error added explaining why.

Regards,

Kevin

unread,
Jul 26, 2021, 1:00:05 PM7/26/21
to AdWords API and Google Ads API Forum
Hi Nadine,

Wonderful to hear that it's possible to get the data without internal error!
I think that allowing for multiple constants to be retrieved in one call would likely be better for both API users and the servers handling the reqeusts.

Keep me up to date on any improvements to functionality or error messaging!

Thanks,
Kevin

Google Ads API Forum Advisor

unread,
Jul 26, 2021, 11:15:43 PM7/26/21
to lopsid...@gmail.com, adwor...@googlegroups.com
Hello Kevin,

I agree that it would be a better experience to be able to get multiples at a time. In the meantime, at least there's a workaround of doing a call to get one keyword theme at a time.  I'm continuing to work with folks to find a solution where we can return multiples; we'll have to make some changes to make that possible.
Reply all
Reply to author
Forward
0 new messages