Performance Max campaigns

847 views
Skip to first unread message

Ігор Shop-bbq

unread,
Dec 3, 2021, 11:24:08 AM12/3/21
to Google Ads Scripts Forum
Hi!

I am using script Account Summary Report to get statistics of all campaigns every day in my google sheet. But Performance Max campaigns information is not included yet for some reasons.
 
Can I add some options to the script to get values of all campaigns including Performance Max?

Google Ads Scripts Forum Advisor

unread,
Dec 6, 2021, 2:51:05 AM12/6/21
to adwords...@googlegroups.com
Hello,

Thank you for reaching out to us.

With regard to your concern, I'm afraid that Performance Max campaigns are currently not supported through the Campaign Performance Report from the AdWords API but data in this regard should be retrievable by pulling the campaign view report from the Google Ads API as discussed in this guide. You should be able to use the Google Ads Query Language to pull the report mentioned in the Export Google Ads Reports into BigQuery solution script and retrieve performance max campaigns data.

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

DB

unread,
Dec 6, 2021, 3:05:01 PM12/6/21
to Google Ads Scripts Forum
Hi guys

I am trying to pull PMAX campaigns data using the new Beta Google ads Script as follow, but not getting any results for PMAX campaigns, is it not supported or am I missing anything?

example code I am trying out:

const query =  
 `SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, customer.currency_code, campaign.status, campaign.serving_status, metrics.ctr, metrics.average_cpc, campaign.campaign_budget, bidding_strategy.type, campaign.advertising_channel_type, campaign.labels, metrics.all_conversions_from_interactions_rate, campaign.start_date
 FROM campaign
 WHERE 
      segments.date BETWEEN "2021-12-01" AND "2021-12-06"`

const search = AdsApp.search(query)
  
while (search.hasNext()) {
    const row = search.next();
    console.log(JSON.stringify(row))
}

Google Ads Scripts Forum Advisor

unread,
Dec 7, 2021, 12:52:47 AM12/7/21
to adwords...@googlegroups.com
Hello,

You may want to check this guide which contains information on how to retrieve attributes and performance metrics for Performance Max campaigns.

DB

unread,
Dec 7, 2021, 6:42:32 AM12/7/21
to Google Ads Scripts Forum
Trying out the example in the link, Getting empty results on this, what am I missing?

    query =   
 `SELECT
  campaign.url_expansion_opt_out,
  campaign.status,
  campaign.bidding_strategy_type
FROM campaign
WHERE campaign.advertising_channel_type = PERFORMANCE_MAX`
    
const search = AdsApp.search(query)
  
while (search.hasNext()) {
    const row = search.next();
    console.log(JSON.stringify(row))
}
  

Google Ads Scripts Forum Advisor

unread,
Dec 8, 2021, 10:32:57 PM12/8/21
to adwords...@googlegroups.com
Hi DB,

Thanks for coming back. Harry here, I work with Teejay.

Kindly provide your Google Ads account ID, script's name and a shareable link to your spreadsheet if available so I can take a look closer at the issue you are encountering. You may send the spreadsheet privately via the reply to author option.

Looking forward to your reply.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

David Baruch

unread,
Dec 9, 2021, 1:35:07 AM12/9/21
to Google Ads Scripts Forum on behalf of adsscripts
Hi Harry

Thanks for reaching out,

Account id : 169-189-4666
script name : temp_beta_d

Best and looking forward,
D

On Thu, Dec 9, 2021 at 5:32 AM Google Ads Scripts Forum on behalf of
adsscripts <adwords...@googlegroups.com> wrote:
>
> Hi DB,
>
> Thanks for coming back. Harry here, I work with Teejay.
>
> Kindly provide your Google Ads account ID, script's name and a shareable link to your spreadsheet if available so I can take a look closer at the issue you are encountering. You may send the spreadsheet privately via the reply to author option.
>
> Looking forward to your reply.
>
> Thanks,
> Harry Cliford Rivera
> Google Ads Scripts Team
>
>
>
> ref:_00D1U1174p._5004Q2SbQHR:ref
>
> --
> -- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/p2f4V68lqD8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/ksWRv000000000000000000000000000000000000000000000R3TWIS00v---xE0JQQq5EJlcalfhXg%40sfdc.net.

Google Ads Scripts Forum Advisor

unread,
Dec 9, 2021, 4:16:19 AM12/9/21
to adwords...@googlegroups.com
Hi D,

Thanks for providing your information. However, I was able to retrieve performance max campaign data using the script below. Would you be able to use the same and let me know if you are still unable to retrieve the expected data? I believe the issue is with the segments.date having an invalid format; you should follow the yyyy-MM-dd format, e.g., 2018-04-17 instead.
  let reportDateFormatted = "2021-12-04"
  var query = "SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, customer.currency_code, campaign.status, campaign.serving_status, metrics.ctr, metrics.average_cpc, "
            + "campaign.campaign_budget, bidding_strategy.type, campaign.advertising_channel_type, campaign.labels, metrics.all_conversions_from_interactions_rate, campaign.start_date FROM campaign "
            + "WHERE campaign.advertising_channel_type = PERFORMANCE_MAX "
            + `AND segments.date BETWEEN '${reportDateFormatted}' AND '${reportDateFormatted}' `
            + "AND campaign.id = 14803357171";
  console.log(query);
  
  var result = AdsApp.search(query);
  while (result.hasNext()) {
    var row = result.next();
    console.log(JSON.stringify(row));
  }
Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

David Baruch

unread,
Dec 9, 2021, 5:01:31 AM12/9/21
to Google Ads Scripts Forum on behalf of adsscripts
Hi Harry

I just updated my script to run the code sample you provided, getting no results...

Any idea?

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/p2f4V68lqD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Dec 9, 2021, 11:18:12 PM12/9/21
to adwords...@googlegroups.com
Hi D,

Thanks for coming back. I just used the same script that you have currently and can see that it did logged data from the performance max campaign with resource name: customers/1691894666/campaigns/14803357171. I would recommend creating a new script instead using the code below which should work with the current scripts version or scripts beta otherwise, please do let me know if the issue persists on your end.

David Baruch

unread,
Dec 9, 2021, 11:58:04 PM12/9/21
to Google Ads Scripts Forum on behalf of adsscripts
Hi Harry

So I created a new script "temp_beta_d2" with the code sample you provided,
Same thing here getting NO campaign results printed (run on preview and normal run)

Please advice,

Best
D

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/p2f4V68lqD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Dec 10, 2021, 4:11:16 AM12/10/21
to adwords...@googlegroups.com
Hello D,

Thanks for trying that out. I am unable to check for any obvious reasons why would the results on your end would differ from mine. Would you be able to provide screenshots where you are getting no data from the script I provided so I can have the rest of the team further investigate? Also, would you be able to ask a colleague of yours that has admin access to your account to run the script and see if they would also encounter the same issue?


Looking forward to your reply.

David Baruch

unread,
Dec 10, 2021, 5:38:20 AM12/10/21
to Google Ads Scripts Forum on behalf of adsscripts
Would you mind providing a POC email to send the screenshots to?
As for admin, its an issue on this account, can try it out on a different one...

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/p2f4V68lqD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.

David Baruch

unread,
Dec 12, 2021, 2:30:12 AM12/12/21
to Google Ads Scripts Forum on behalf of adsscripts
Hi Harry 

Here is another account, in which I am Admin, getting the same results.

test_beta_d

I'll be happy to jump on call, having a frontal video meeting trying to resolve this issue,

PLMK,

Best,
DB

Google Ads Scripts Forum Advisor

unread,
Dec 13, 2021, 2:57:06 AM12/13/21
to adwords...@googlegroups.com
Hi DB,

Thanks for coming back. Unfortunately, our team can only provide assistance via this forum channel and through emails. You can provide private information or the screenshots via the reply to author option and if that is unavailable on your end, you can shoot a message to our email (googleadsscr...@google.com) instead. I should be able to tap the rest of the team for further investigation once you come back.

Google Ads Scripts Forum Advisor

unread,
Dec 14, 2021, 2:46:15 AM12/14/21
to adwords...@googlegroups.com
Hello DB,

Thank you for your continued cooperation on this. Allow me to tap the rest of the team for further investigation with regard to the issue at hand and rest assured that I will get back you as soon as new information becomes available. Let me know if there's anything else I can assist you with in the meantime.

David Baruch

unread,
Dec 28, 2021, 5:11:51 AM12/28/21
to Google Ads Scripts Forum on behalf of adsscripts
Hi Harry

Trust all is well.

Would appreciate any update on this item

Best and looking forward,
DB

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/p2f4V68lqD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Dec 29, 2021, 1:35:51 AM12/29/21
to adwords...@googlegroups.com
Hi DB,

I work along with Harry. As per checking, I'm afraid that this is still under investigation. We'll let you know the soonest we have our findings.

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

Mat

unread,
Jan 13, 2022, 8:53:43 AMJan 13
to Google Ads Scripts Forum
Hello, any updates? I have the same issue: no data for Performance Max in the reports.
Example query: "SELECT customer.descriptive_name, campaign.name, campaign.advertising_channel_type FROM campaign WHERE campaign.advertising_channel_type = PERFORMANCE_MAX"

Google Ads Scripts Forum Advisor

unread,
Jan 13, 2022, 10:09:55 PMJan 13
to adwords...@googlegroups.com
Hi Mat,

Thanks for reaching out here. Unfortunately, there are still no updates on the issue raised here. Would you mind providing your Google Ads account ID and script name and relay that back to our wider team to further their investigation? Rest assured that I will get back to you as soon as new information on the issue becomes available.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

MATTHEW Dworkin

unread,
Feb 2, 2022, 4:17:23 AMFeb 2
to Google Ads Scripts Forum
Hi there,

Are there any updates? I'm having the same issue, I can't seem to pull any Performance Max campaigns when I pull a report.

Best,
Matt

Google Ads Scripts Forum Advisor

unread,
Feb 3, 2022, 12:33:01 AMFeb 3
to adwords...@googlegroups.com

Hello Matt,

 

I’m James, a colleague of Harry. Thank you for your patience.

 

Currently, we haven’t received any updates from the team and there’s no ETA yet regarding the fix of this issue as our team is continuously investigating the root cause of the issue. Having said that, rest assured that we will get back to you once we receive significant feedback from the rest of the team.

 

Regards,

Google Logo
James Howell Abarsoza
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

Giel

unread,
Feb 9, 2022, 5:59:48 AMFeb 9
to Google Ads Scripts Forum
Hi James,

I'm having the same issue here. And did some investigating. 
I can't get the performance max data with the old and the new version of the script. This also includes account level data. So account cost or cost_micros on customer level are missing the cost (and other data) from the performance Max campaigns. This is also the case when using the "search" method which sould retrieve data from the Google Ads API instead of the Adwords API.
I tested on Manager Account and account level.

But I can get the performance Max data when using the Google Ads API outsite of Google Ads Scripts. 

Hope your team will find a solution soon.

Best,
Giel

Google Ads Scripts Forum Advisor

unread,
Feb 10, 2022, 1:24:04 AMFeb 10
to adwords...@googlegroups.com

Hello Giel,

 

Thank you for chiming in on this thread.

 

Kindly provide the following details below so that I can take a look closer at the issue you are encountering and raise it to our internal team also if necessary. 

  • Google Ads account ID / CID
  • Script's name 
  • Shareable link to your spreadsheet, if available 

 

You may send the requested information via  ‘Reply privately to author’ option. If the private option is not available on your end, then please send it over through this alias <googleadsscr...@google.com>  instead.

 

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

Giel

unread,
Feb 15, 2022, 10:01:41 AMFeb 15
to Google Ads Scripts Forum
Hi James,

Any news on this? For a lot of scripts it's really an issue this isn't working properly.

Thanks!
Giel

Google Ads Scripts Forum Advisor

unread,
Feb 15, 2022, 11:56:02 PMFeb 15
to adwords...@googlegroups.com

Hello Giel,

 

Thank you for your patience. I regret to inform you that there are no updates yet from the team as we are continuously investigating the root of the issue. However, I will follow up this to them and rest assured that we will get back to you with an update.

Rafael Setti

unread,
Mar 15, 2022, 1:58:07 AMMar 15
to Google Ads Scripts Forum
HI everyone, any uptades on this topic? I'm having the same issue. Can't get the performance max data.

Thanks! 
Rafael

Blaise Reymondin

unread,
Mar 15, 2022, 4:24:02 AMMar 15
to Google Ads Scripts Forum
Any script analyzing an account that contains performance max campaigns becomes unusable. It's hard to understand why Google's roadmap doesn't include all the peripheral tools...

Google Ads Scripts Forum Advisor

unread,
Mar 15, 2022, 6:19:55 AMMar 15
to adwords...@googlegroups.com
Hi all,

Thank you for following up. However, I'm afraid that this is still under investigation. We'll update this thread the soonest we finalize our findings.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

Giel

unread,
Mar 16, 2022, 4:49:22 AMMar 16
to Google Ads Scripts Forum
Hi All,

I did some testing yesterday and this morning again. I think there might be positive developments after all:
1. The new Google Ads scripts beta documentation redirects to the main documantation of ads scripts. Indicating it is out of beta?
2. The new Google Ads scripts environment does include the results of Performance Max campaigns in the account (customer) results.
3. Google has updated the  Account summary report for the new environment. I tested it and in my test it included the Performance Max results.
4. Yesterday it was not possible to get the results on the campaign level, but I tested it again this morning and now it is. So you can get the results for just your Performance Max campaigns.
5. Also since this morning you are able to get the results of Performance Max campaigns in the old Google Ads scripts environment. As long as you use the AdsApp.search method. Which fetches the data from the new Google Ads API instead of the old Google AdWords API.

So to get the Performance Max results either update you scripts in the old environment to include fetch the data via the AdsApp.search method or switch to the new environment.

Hope this helps!

Best, 
Giel

Blaise Reymondin

unread,
Mar 16, 2022, 3:57:45 PMMar 16
to Google Ads Scripts Forum
Yes, the update has been done today. Now I finally see a P Max campaign returned in my test script. Hurrah.

16/03/2022 20:55:10
{"campaign":{"resourceName":"customers/6758978837/campaigns/15290889753","advertisingChannelType":"PERFORMANCE_MAX","name":"CH/fr PMax"},"segments":{"date":"2022-03-15"}}



Google Ads Scripts Forum Advisor

unread,
Mar 17, 2022, 1:43:18 AMMar 17
to adwords...@googlegroups.com

Hello Everyone,

Thanks for sharing your observations regarding the Performance Max campaigns.

It's good to know that you can now retrieve those campaigns on your respective scripts.

For any script-relate concerns, do let our team know and we'll be happy to further assist you.

Regards,

Google Logo
Mark Kevin
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref
Message has been deleted

Blaise Reymondin

unread,
Mar 22, 2022, 10:30:20 AMMar 22
to Google Ads Scripts Forum
Hello,

Unfortunately it looks that the Performance Max campaigns ist still not deployed among all objects / methods in the API.

The following code using the AdsApp.campaigns() method returns: 

# of campaign to check: 2

But in my account I have 3 enabled campaigns in this case (2 SEARCH + 1 P MAX).

Here is the script:

  var campaignSelector = AdsApp.campaigns().withCondition("Status = ENABLED");
  var campaignIds = [];
  var campaignIterator = campaignSelector.get();
  while (campaignIterator.hasNext()) {    
    var campaign = campaignIterator.next();
    var campaignId = campaign.getId();
    campaignIds.push(campaignId) ;      
  }
 
  Logger.log(" # of campaign to check: " + campaignIds.length);



Thanks again for your investigations / help.

Blaise


Blaise Reymondin

https://blaisebruno.com

Google Ads Scripts Forum Advisor

unread,
Mar 24, 2022, 6:19:40 AMMar 24
to adwords...@googlegroups.com
Hi Blaise,

Other users reported that they weren't able to get the Performance Max campaign, but later reported back that they can now. With this, could you please try again at least tomorrow, then let me know how it goes?

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

Blaise Reymondin

unread,
Mar 28, 2022, 7:46:51 AMMar 28
to Google Ads Scripts Forum
Hi Teejay,

The problem is that the problem has only partially been solved and some methods of the API still not return any Performance Max campaigns. In my previous examples we cannot get the Performance Max campaigns via AdsApp.campaigns()

In summary, from my latest tests today:

AdsApp.report() ✅
AdsApp.search() ✅
AdsApp.campaigns() ❌

It should be quite easy for you to test / replicate this.

Best,
Blaise

Google Ads Scripts Forum Advisor

unread,
Mar 29, 2022, 2:10:58 AMMar 29
to adwords...@googlegroups.com

Hello Blaise,

 

Thank you for reporting this back to us.

 

I believe the issue is still being investigated and is currently in progress to resolved any relevant misbehaviors. We will update you on this thread once the full fixed has been released.

Regards,

Google Logo
Michael Angelo
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2SbQHR:ref

Wesley Phuong

unread,
Apr 6, 2022, 4:08:57 AMApr 6
to Google Ads Scripts Forum
Hi Teejay, any updates on this topic? 

Reinforcing Blaise last post; I just recently in the last few hours also tried utilizing AdsApp.campaigns too and have failed to retrieve any Performance Max campaigns. 

My script is as follows: 

function main() {
var campaignIterator = AdsApp.campaigns().withCondition("campaign.status = ENABLED").get();

while (campaignIterator.hasNext()) {
var campaign = campaignIterator.next();
var cn=campaign.getName().replace(/\s/g,'_');
campaign.urls().setCustomParameters({campaign: cn});
}
}


Thanks,
Wesley

Google Ads Scripts Forum Advisor

unread,
Apr 6, 2022, 11:26:47 PMApr 6
to adwords...@googlegroups.com
Hi Wesley,

Thank you for following up. I am also a member of the Google Ads scripts team and let me provide support to your concern.

I can see that your concern has already been raised to another email thread. With this, I would suggest to continue the discussion of this issue there for better tracking of updates.

Regards,
Google Logo
Ernie John
Google Ads Scripts Team
 


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