Not able to create custom conversion goals in google ads version 17 via rest api

53 views
Skip to first unread message

globe media (GPL)

unread,
Jul 10, 2024, 12:33:17 PM7/10/24
to Google Ads API and AdWords API Forum
Hello ,

i am using rest api for creating campaign ,i need set campaign conversion goals neither the generic nor the custom ,

const createConversionGoals = async (
  customerId,
  accessToken,
  developerToken
) => {
  const goals = {
    campaign: "customers/3300782374/campaigns/21459121432",
    category: "PURCHASE",
    origin: "WEBSITE",
    resourceName: "customers/3300782374/campaignConversionGoals/21459121432~PURCHASE~WEBSITE",
  };

  try {
    const response = await axios.post(
      https://googleads.googleapis.com/v17/customers/${customerId}/campaignConversionGoals:mutate,
      {
        operations: [{ update: goals, updateMask: "origin, campaign, resourceName" }],
      },
      {
        headers: {
          Authorization: Bearer ${accessToken},
          "developer-token": developerToken,
          "login-customer-id": customerId,
          "Content-Type": "application/json",
        },
      }
    );

    console.log("Response data:", response.data);
    // const budgetResourceName = response.data.results[0].resource_name;
    return response.data;
  } catch (error) {
    console.error("Error creating Conversion Goals:", error.response.data);
    return error.response.data;
  }
};

Please hlep me figure this out  

Google Ads API Forum Advisor

unread,
Jul 10, 2024, 5:04:29 PM7/10/24
to akashdu...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Based on the information provided, I understand that you are not able to create the custom conversion goals from version 17 using the Google Ads API. Kindly note that you have provided code and it doesn't contain the error message. In order to investigate your issue further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end to better assist you further. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJsTq:ref" (ADR-00246034)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


globe media (GPL)

unread,
Jul 11, 2024, 4:54:31 AM7/11/24
to Google Ads API and AdWords API Forum
We can create the resource successfully, but unfortunately, we cannot see the linkage between the campaign and the conversion goal.
Here's the API we are using - `https://googleads.googleapis.com/v17/customers/${customerId}/campaignConversionGoals:mutate`,
  const goals = {
    campaign,
    category: "SIGNUP",
    origin: "WEBSITE",
    resourceName: `customers/${customerId}/campaignConversionGoals/${campaign}~SIGNUP~WEBSITE`,
  };
this is the response that we are getting - 
{
    "results": [
        {
            "resourceName": "customers/3300782374/campaignConversionGoals/21449025537~SIGNUP~WEBSITE"
        }
    ]
}
where exactly do we have to see, this data, how do we know if the campaign conversion goals are linked with this campaign?
Are we missing any steps?
also, It's not reflecting on the Google Ads API
Screenshot 2024-07-11 at 2.08.16 PM.png

Google Ads API Forum Advisor

unread,
Jul 11, 2024, 10:38:36 AM7/11/24
to akashdu...@gmail.com, adwor...@googlegroups.com
Hi,

You can use the following query to check the link between the campaign "Zyper Test Campaign with GOALS for Max conversion ROAS" and the conversion goal through campaign_conversion_goal resource.
SELECT campaign_conversion_goal.campaign, campaign_conversion_goal.category, campaign_conversion_goal.origin, campaign_conversion_goal.biddable, campaign.id, campaign.name 
FROM campaign_conversion_goal WHERE campaign.advertising_channel_type = 'SEARCH'

{
      "campaign": {
        "resourceName": "customers/3300782374/campaigns/21449025537",
        "name": "Zyper Test Campaign with GOALS for Max conversion ROAS",
        "id": "21449025537"
      },
      "campaignConversionGoal": {
        "resourceName": "customers/3300782374/campaignConversionGoals/21449025537~SIGNUP~WEBSITE",
        "campaign": "customers/3300782374/campaigns/21449025537",
        "category": "SIGNUP",
        "origin": "WEBSITE"
      }
    },
You can try making a request using the Search or SearchStream by passing the customer Id. Also, you can use Query Builder to create your query and Query Validator to validate your query. I hope this helps, let me know how this goes on your end.
Reply all
Reply to author
Forward
0 new messages