custom metrics

155 views
Skip to first unread message

reporting info

unread,
Jun 19, 2023, 12:29:48 PM6/19/23
to Google Ads Scripts Forum
I am creating a script that will pause my video ads when the cost is equal to 10 and the CPC is greater than 1.50. Additionally, I want to check a custom metric called ATC (AddToCart). Is there a way to access this metric?

Account ID: 280-950-0619
Script Name: Fase 1 - CPC > 1.50

Google Ads Scripts Forum

unread,
Jul 18, 2023, 3:20:44 AM7/18/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/XLb02XUQNW4) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Jul 18, 2023, 3:32:00 AM7/18/23
to Google Ads Scripts Forum
Hi,

Thank you for reaching out to the Google Ads Scripts Support Team. Please excuse us for only getting back now as your message failed to be routed to our support queue.

I checked the script on my end, and it appears that you are accessing the correct methods for video ads, such as the use of getStatsFor() <https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_videoad#getStatsFor_1> when getting it's cost and average CPC. If you'd like to pause the video ads once they've reached a threshold, you can use the method pause() <https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_videoad#pause_0>.

As for checking the custom metric, would you be able to clarify and provide a complete and uncropped screenshot showing this in the Google Ads UI so that we may be able to have a better understanding of the information you'd like to pull and guide you accordingly? You may send these privately via the Reply to author option. Note that you may need to join the Google Group for you to use this option. If this option is not available on your end still, you may send it through our email (googleadsscr...@google.com) instead.

Best regards,
Google Ads Scripts Support Team
Message has been deleted

Nils Rooijmans

unread,
Jul 27, 2023, 3:26:22 AM7/27/23
to Google Ads Scripts Forum
you can use a GAQL query to get a list of all the campaigns that show zero conversions for the named conversion action.

Here's an example to get you started:

function main() {

  var campaignIds = [];

  var gaqlQuery = "SELECT campaign.id, metrics.all_conversions, segments.conversion_action_name FROM campaign WHERE segments.conversion_action_name = 'ClickMagick - BeginCheckout' AND metrics.all_conversions = 0 AND segments.date DURING LAST_30_DAYS";

  var queryResults = AdsApp.search(gaqlQuery);

  while (queryResults.hasNext()) {
    var result = queryResults.next();
    var campaignId = result.campaign.id;
    campaignIds.push(campaignId);
  } 
  // at this time the variable  campaignIds contains all the ids of the campaigns that meet the criteria in your WHERE clause in  gaqlQuery 
}

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

On Wednesday, 26 July 2023 at 22:44:03 UTC+2 reporting info wrote:
I have created a custom column called ATC, which brings me the number of conversions related to the Conversion Action called ClickMagick - BeginCheckout. What I want to do is add a condition that, when the ad has spent a certain amount and there are no BeginCheckout conversions, then turn it off. However, I don't know how to access the custom metric called ATC or the Conversion Action called ClickMagick - BeginCheckout to apply the condition.

custom fields.PNG

Google Ads Scripts Forum Advisor

unread,
Jul 27, 2023, 5:14:19 AM7/27/23
to adwords...@googlegroups.com

Hi All,

 

Please excuse us for only getting back now as your message failed to be routed to our support queue.

 

@Nils - Thank you so much for providing your approach for this concern.

 

First, I would like to inform you that I had to remove your message as it had contained private information. Kindly scrub private information when posting as this forum is public, moving forward. We are hoping for your kind understanding on this.

 

You can follow Nils' approach, as I believe it's a good approach to follow in order to access information regarding the conversion action you've specified. On that note, I'm afraid that the retrieval of custom columns via Google Ads Scripts is not supported yet. However, I would like to note that there already is a request raised in order to have the feature exposed via said tool, but we would not be able to provide a definite timeline with regard to it's release and would recommend you instead keep an eye on our Ads Developer Blog <https://ads-developers.googleblog.com/search/label/google_ads_scripts> for future updates and latest announcements.

 

Let us know if we can assist you with anything else.

 

This message is in relation to case "ref:_00D1U1174p._5004Q2mwIyI:ref"

Thanks,
 
Google Logo Google Ads Scripts Team


Reply all
Reply to author
Forward
0 new messages