Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
How to define accountName The resource name of the account that owns the collection of ad clients

I'm trying to use Adsense management API in Google Sheets using apps script which runs with javascript.

I'm unable to define "accountName " even knowing "This sample lists all of the ad clients for a given account. Specify the account as a resource name, for example, accounts/pub-12345."

documentation: https://developers.google.com/apps-script/advanced/adsense#list_ad_clients

Here is the code

`

enter code here`/**
 * Logs available Ad clients for an account.
 *
 * @param {string} accountName The resource name of the account that owns the
 *     collection of ad clients.
 */
function listAdClients(accountName) {
  let pageToken;
  do {
    const response = AdSense.Accounts.Adclients.list(accountName, {
      pageToken: pageToken
    });
    if (!response.adClients) {
      Logger.log('No ad clients found for this account.');
      return;
    }
    for (const adClient of response.adClients) {
      Logger.log('Found ad client for product "%s" with resource name "%s".',
          adClient.productCode, adClient.name);
      Logger.log('Reporting dimension ID: %s',
          adClient.reportingDimensionId ?? 'None');
    }
    pageToken = response.nextPageToken;
  } while (pageToken);
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

enter image description here

after declaring the function, add the accountName in the const response.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!