Campaign Feed creation for Sitelink thrown exception

21 views
Skip to first unread message

Swaroop k l

unread,
Nov 25, 2019, 7:19:57 AM11/25/19
to AdWords API and Google Ads API Forum
Hi Team,
When we are creating campaign feed for sitelinks which is throwing an exception saying that " INVALID_FUNCTION_FORMAT". 
Could you please assist here? And also, please provide an example for "Add sitelinks to a campaign using feeds" in Java.

Request
-------
MethodName: google.ads.googleads.v2.services.CampaignFeedService/MutateCampaignFeeds
Headers: {developer-token=REDACTED, login-customer-id=xxxxxx, x-goog-api-client=gl-java/1.8.0_111 gapic/ gax/1.45.0 grpc/1.21.0}
Body: customer_id: "xxxxxx"
operations {
  create {
    feed {
      value: "customers/xxxxxx/feeds/xxxxxx"
    }
    campaign {
      value: "customers/xxxxxx/campaigns/xxxxxx"
    }
    placeholder_types: SITELINK
    matching_function {
      left_operands {
        constant_operand {
          string_value {
            value: "FEED_ITEM_ID"
          }
        }
      }
      right_operands {
        constant_operand {
          long_value {
            value: xxxxxx
          }
        }
      }
      operator: IN
    }
  }
}


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=5JOha4RSy-SlUDRWKcuX-w,date=Mon, 25 Nov 2019 12:07:56 GMT,alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000)
Body: null
Failure message: errors {
  error_code {
    function_error: INVALID_FUNCTION_FORMAT
  }
  message: "The format of the function is not recognized as a supported function format."
  trigger {
    string_value: ""
  }
  location {
    field_path_elements {
      field_name: "operations"
      index {
      }
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "matching_function"
    }
  }
}

Thank you.
Swaroop

Google Ads API Forum Advisor Prod

unread,
Nov 25, 2019, 3:23:29 PM11/25/19
to swaro...@gmail.com, adwor...@googlegroups.com
Hi Swaroop, 

The error indicates that there is an issue with the Matching function. Could you please confirm if you have tried the request with both the function_string and the operands? If yes, could you please share the request and response logs without redacting to check this further using Reply privately to author option? We do not have a code sample which illustrates the Matching function implementation in Ads API to add sitelinks to a campaign using feeds. You may refer to this guide which might be helpful. 

Thanks,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UODBRB:ref
Reply all
Reply to author
Forward
0 new messages