Posts under category Google

I have python script to download the google ad historical report through the API. I am having below as report job

{       'reportQuery': {           'dimensions': [                          'DATE',                          'MOBILE_APP_NAME',                          'ADVERTISER_NAME',                          'ADVERTISER_ID',                          'AD_UNIT_ID',                          'AD_UNIT_NAME',                          'LINE_ITEM_NAME',                          'LINE_ITEM_ID',                          'LINE_ITEM_TYPE',                          'CREATIVE_TYPE',                          'CREATIVE_NAME',                          'CREATIVE_ID',                          'MOBILE_DEVICE_NAME'                          'PLACEMENT_NAME',                          'PLACEMENT_ID'                          ],           'dimensionAttributes': [                                   'AD_UNIT_CODE',                                   'LINE_ITEM_PRIORITY'                                   'CREATIVE_CLICK_THROUGH_URL'                                     'ADVERTISER_EXTERNAL_ID'                                   ],           'columns': [                      'AD_SERVER_IMPRESSIONS',                      'AD_SERVER_CLICKS',                       'AD_SERVER_CTR',                       'AD_EXCHANGE_IMPRESSIONS',                       'AD_SERVER_CPM_AND_CPC_REVENUE',                       'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'           ],           'dateRangeType': 'CUSTOM_DATE',           'startDate': start_date,           'endDate': end_date       }   } 

I am getting below error

Failed to generate report. Error was: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS @ columns; trigger:'AD_EXCHANGE_IMPRESSIONS' 

I am not sure which dimension need to include for AD_EXCHANGE_IMPRESSIONS. When I generate report with same fields in UI it works fine without errors

My Apps gets crash with following Crashlytics console description:

Fatal Exception: UIApplicationInvalidInterfaceOrientation

Supported orientations has no common orientation with the application, and [GADFullScreenAdViewController shouldAutorotate] is returning YES

App supports all orientations except when a user switches player in fullscreen mode. I use a method in AppDelegate to manage supported orientations:

var supportedOrientation = UIInterfaceOrientationMask.all func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {    return self.supportedOrientation } 

I am trying to access the Google Adwords API, as described in their help-file via following sample code:

from googleads import adwords client = adwords.AdWordsClient.LoadFromStorage() targeting_idea_service = client.GetService('TargetingIdeaService', version='v201809') selector = {'ideaType': 'KEYWORD',            'requestType': 'IDEAS',            'requestedAttributeTypes': ['KEYWORD_TEXT',                                        'SEARCH_VOLUME',                                        'CATEGORY_PRODUCTS_AND_SERVICES'],            'paging': {'startIndex': '0',                       'numberResults': '100'                       },            'searchParameters': [{'xsi_type': 'RelatedToQuerySearchParameter',                                  'queries': ['cats']}]            } page = targeting_idea_service.get(selector) print(page) 

However, when I try to call the API, following error occures:

zeep.exceptions.Fault: [TargetingIdeaError.INVALID_SEARCH_PARAMETERS @ selector.searchParameters.searchParameters[0]; trigger:'RelatedToQuerySearchParameter'] 

Any idea what could cause this error? In my googleads.yaml file (which is called properly, following parameters are set:

# AdWordsClient configurations adwords:   developer_token:    client_id:   client_secret:   refresh_token: 

I am trying to integrate Oauth2 into my Flask application, and am having some issues with keeping the flow persistent despite a redirect.

def account(): form = UpdateAccountForm() authorization_url = '' auth_code = request.args.get('code') if request.method == 'POST':     if request.form['submit_button'] == 'Test':         flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file('client_secret.json',      scopes=['https://www.googleapis.com/auth'])         flow.redirect_uri = 'http://127.0.0.1:5000/account'         authorization_url, state = flow.authorization_url(access_type='offline',                  prompt='consent', include_granted_scopes='true')         print('Please go to this URL: {}'.format(authorization_url)) if auth_code != None:     flow.fetch_token(code=auth_code)     credentials = flow.credentials     print(credentials) 

Upon button click, the Oauth flow is initiated and the user is presented with a link to a Google page in which they grant my application access to some of their features. Then, the user is redirected back to the same page but with an authorization code attached to the request which is fed back into the flow and allows me to gain access the users credentials.

This part:

if auth_code != None:     flow.fetch_token(code=auth_code)     credentials = flow.credentials     print(credentials) 

When the page reloads I get:

UnboundLocalError: local variable 'flow' referenced before assignment

I assume this happens because the flow is no longer initialized when the page loads, and obviously I can't initialize a new flow the next time the page loads because the object would be different.

I am not sure how to approach this problem within Flask, what would be the best way to keep the flow consistent?

EDIT: This question is different from the suggested duplicate because this uses Oauthlibs Flow module as opposed to the previously suggested. The closest answer is here: https://developers.google.com/identity/protocols/OAuth2WebServer but still inadequate.

I'm creating a remarketing audience list in Google analytics and after setting audience definition when I add audience destinations, I only see 0 as the audience size in google ads. In google ads, it keeps showing me the audience list is too small. But even if I try to retarget a subdomain, it still shows up too small. It happened since last October. Did Google change any configuration or algorithm? Thanks all!