MCC script for report of RSA without pinned headline 1

91 views
Skip to first unread message

Misty Harper

unread,
May 18, 2023, 8:48:13 AM5/18/23
to Google Ads Scripts Forum
Hello Google Ads Scripts Team,

We'd like to identify any enabled RSAs in our MCC that do not have the first headline pinned   ( pinnedField=HEADLINE_1 )

Would this be possible? Could we iterate through all RSAs and append a row to a spreadsheet if pinning is NULL for HEADLINE_1 ? 


getHeadlines()

Is it possible to check only Headline_1 with getHeadlines() and to create an if statement related to whether that headline is pinned? 

Our goal is to compare cost per lead of RSAs with headline 1 pinned to RSAs with no pinning.

We'll be grateful for any help you can provide on this request!
Misty

Misty Harper

unread,
May 18, 2023, 10:01:11 AM5/18/23
to Google Ads Scripts Forum
The version below is what I tried - the error message is 
TypeError: myreport is not iterable at main (Code:23:23) at Object.<anonymous> (adsapp_compiled:19656:54)

Thanks!



function main() {

      const labelName = 'A-D';
 
const accIter = AdsManagerApp.accounts()
  .withCondition(`LabelNames CONTAINS "${labelName}"`)
  .get();    
 
  while (accIter.hasNext()) {
    var account = accIter.next();
    AdsManagerApp.select(account);
   
   
    const myreport = AdsApp.report(
   
 'SELECT ad_group_ad_asset_view.pinned_field, ad_group_ad_asset_view.ad_group_ad, metrics.conversions, metrics.clicks, metrics.average_cpc, metrics.cost_per_conversion, metrics.ctr, metrics.impressions, ad_group.id, ad_group.name, ad_group.status, ad_group_ad.ad.responsive_search_ad.headlines, campaign.id, campaign.name, campaign.status, ad_group_ad.ad.id FROM ad_group_ad_asset_view WHERE ad_group_ad.ad.type = RESPONSIVE_SEARCH_AD AND metrics.impressions > 0 AND ad_group_ad.status = ENABLED AND campaign.status = ENABLED AND ad_group.status = ENABLED AND segments.date DURING LAST_30_DAYS');
    for (const row of myreport) {
    const cmpgnid = row.campaign.id;
    const agid = row.ad_group.id;
      const ag = row.ad_group.name;
      const pinned = row.ad_group_ad_asset_view.pinned_field;
      const adid =  row.ad_group_ad.ad.id;
      const conv = row.metrics.conversions;
      const clicks = row.metrics.clicks;
      const CPL = row.metrics.cost_per_conversion;
      const imp = row.metrics.impressions;
    console.log(`${cmpgnid}, ${agid}, ${ag}, ${pinned}, ${adid}, ${conv}, ${clicks}, ${CPL}, ${imp}`);
  }
}
}

Google Ads Scripts Forum Advisor

unread,
May 19, 2023, 5:33:09 PM5/19/23
to adwords...@googlegroups.com

Hi,

I'm from the Google Ads Scripts team.

In order for us to further investigate and provide you with accurate guidance, could you elaborate more on your use-case? It would be great if you can provide some screenshots of what you're trying to retrieve in your script or a sample script, if there's any, of what you've tried so far. Additionally, please provide your Google Ads account ID or CID for our reference. You may send these to us via Reply privately to author option.

Regards,
 

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

Thanks,
 
Google Logo Google Ads Scripts Team


Message has been deleted

Misty Harper

unread,
May 30, 2023, 3:46:21 PM5/30/23
to Google Ads Scripts Forum
Hi Google Ads Scripts Team,
I can't reply to author, so I will email the manager account CID to googleadsscr...@google.com

Our use case is to be able to compare conversion rate and cost per lead for RSA that have headline 1 pinned to the performance of RSA that do not have headline 1 pinned. We need to do this across our manager account which has more than 1,000 active accounts. 

From an ad download in the ads area of the Google Ads UI, if we download the ads we have a column for headline 1 pinned to position 1, but we cannot replicate that in an MCC report through the reports section of the Google Ads UI,  so are hoping to be able to do that with Google Scripts. Even if we could just pull the Ad Id for all enabled ads in our MCC that have headline 1 pinned to position 1, we could then pull an MCC ad report through the Google Ads UI and get the CPL and Conversion Rate performance comparison from that, rather than through an MCC script that uses the ad_group_ad_asset_view.pinned_field   Could we write an AWQL query that would return the AdID (ad_group_ad.ad.id) of all ads that have headline 1 pinned to position 1? Thanks!
ad headline detail.JPG

Google Ads Scripts Forum Advisor

unread,
Jun 2, 2023, 7:15:03 AM6/2/23
to adwords...@googlegroups.com

Hi Misty,

 

Confirming that our team received the information you had sent.

 

Please be informed that reporting via Google Ads Scripts or the API only mirrors that of the UI's behaviour. Could you please confirm if you were unable to replicate the report at the MCC level, but could replicate it at the child account level?

 

If yes, could you please provide a complete and uncropped screenshot showing the information you had mentioned (which are ads that have headline 1 pinned to position 1) so that we may be able to have a better visualization of what you would like to retrieve from the Google Ads UI? This is also so we may be able to guide you on the fields which you may use for reporting.

 

Kindly send it again 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.

Reply all
Reply to author
Forward
0 new messages