Posts under category google-ads-api

I'm trying to find the corresponding label for the column CountryCriteriaId, the column is coming from p_GeoStats_*.

The schema description says that I can find the label in LocationCriterionService but as far I understand that's a Google Adwords API function rather a table in Big Query.

Do you know where can I find the labels inside the Adwords schema?

The Script I'm trying to set up uses the MailApp service to send emails to recipients included in a Ghseet.

function sendProcessingEmail() {   var customerId = AdsApp.currentAccount().getCustomerId();   if (config.emailEachRun && config.emailRecipients &&       config.emailRecipients.length) {     MailApp.sendEmail(         config.emailRecipients.join(','),         customerId + ': Link Checker: Checking is ongoing',         'Link checking is still running on account: ' + customerId +             '. For more details see the spreadsheet: ' +             CONFIG_SPREADSHEET_URL);     setDateAsNow('dateEmailed'); 

I have noticed that the Script works fine for emails made out of a combination of numbers and letters but fails to send an email when the address contains other characters. Was wondering if anyone knows a workaround for this? Many thanks in advance.

I have encounter a problem with the google ads report and I have no clue how to fix it... I use the following code to extract the data from google ads via API call

import sys from googleads import adwords import pandas as pd import pandas as np import io output = io.StringIO() def main(client):   # Initialize appropriate service.   report_downloader = client.GetReportDownloader(version='v201809')   # Create report query.   report_query = (adwords.ReportQueryBuilder()                   .Select('CampaignId', 'AdGroupId', 'Id', 'Criteria',                           'CriteriaType', 'FinalUrls', 'Impressions', 'Clicks',                           'Cost')                   .From('CRITERIA_PERFORMANCE_REPORT')                   .Where('Status').In('ENABLED', 'PAUSED')                   .During('LAST_7_DAYS')                   .Build())   # You can provide a file object to write the output to. For this   # demonstration we use sys.stdout to write the report to the screen.   report_downloader.DownloadReportWithAwql(       report_query, 'CSV', output, skip_report_header=False,       skip_column_header=False, skip_report_summary=False,       include_zero_impressions=True)   output.seek(0)   df = pd.read_csv(output)   df = df.to_csv('results.csv') if __name__ == '__main__':   # Initialize client object.   adwords_client = adwords.AdWordsClient.LoadFromStorage()   main(adwords_client) 

the code works as expected and pulls the data and save it in a CSV file, however, when I access the columns it prints just one column 'CRITERIA_PERFORMANCE_REPORT (Nov 5, 2019-Nov 11, 2019)' when I open the csv file looks like this

result.csv

I have tried to drop the first row with df.drop(df.index[0]) to access the rest of the data however nothing seems to be working. is there any way I can remove the first row or change to use the second row as the columns names which is the result I expected.

thanks in advance

Someone please show me what I'm missing here. I've run the following command: pip install google-ads (see here: https://pypi.org/project/google-ads/) several times. I've also downloaded the tar and run the setup.py file (python setup.py build install).

Following the instructions, I try to import:

import google.ads.google_ads.client 

and I get the following error consistently:

ModuleNotFoundError                       Traceback (most recent call last) <ipython-input-106-df47157331b2> in <module>() ----> 1 import google.ads.google_ads.client ModuleNotFoundError: No module named 'google.ads' 

I can make a call using curl so I know that the configuration is set up properly. For what it's worth, I downloaded the Facebook marketing Python sdk an hour earlier and that works just fine.

I am using the Google Oauth2 API to connect to Google Ads and become only one refresh token when my @gmail.com account has read access to two different Google Ads accounts.

I have the account a@gmail.com. This account has read access to the Google Ads accounts b@gmail.com and c@gmnail.com.

When I create two connections to Google Ads with the email a@gmail.com for the accounts b@gmail.com and c@gmail.com, then I receive only one refresh token, for the first connection and none refresh token for the second connection. Why? How can I manage this, to become 2 refresh tokens for each connection? The only way to become a refresh token for the second connection is to go to my account a@gmail.com and to decline the access to my app manually and connect again with c@gmail.com. But then b@gmail.com has no refresh token anymore.

code:

$oauth2 = new OAuth2(             [                 'authorizationUri' => $this->container->getParameter('oauth2.google.adwords.authorizationUri'),                 'tokenCredentialUri' => $this->container->getParameter('oauth2.google.adwords.tokenCredentialUri'),                 'redirectUri' => $this->container->getParameter('domain.system') . $this->container->getParameter(                         'oauth2.google.adwords.redirectUri.advertiser'                     ),                 'clientId' => $this->container->getParameter('oauth2.google.adwords.clientId'),                 'clientSecret' => $this->container->getParameter('oauth2.google.adwords.clientSecret'),                 'scope' => $this->container->getParameter('oauth2.google.adwords.scope')             ]         ); // Create a 'state' token to prevent request forgery.             // Store it in the session for later validation.             $randomState = sha1(openssl_random_pseudo_bytes(1024)) . '---' . $accountId;             $oauth2->setState($randomState);             // Redirect the user to the authorization URL.             $config = [                 // Set to 'offline' if you require offline access.                 'access_type' => 'offline',                 'approval_prompt' => 'force'             ];             // redirect to google ads             return new RedirectResponse($oauth2->buildFullAuthorizationUri($config));