How to use the googleads.ad_manager.AdManagerClient function in googleads

To help you get started, we’ve selected a few googleads examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleads / googleads-python-lib / examples / ad_manager / v201808 / product_package_service / get_active_product_packages.py View on Github external
statement.ToStatement())
    if 'results' in response and len(response['results']):
      for product_package in response['results']:
        # Print out some information for each product package.
        print('Product package with ID "%d" and name "%s" was found.\n' %
              (product_package['id'], product_package['name']))
      statement.offset += statement.limit
    else:
      break

  print '\nNumber of results found: %s' % response['totalResultSetSize']


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)
github googleads / googleads-python-lib / examples / ad_manager / v201905 / reconciliation_order_report_service / submit_reconciliation_order_reports.py View on Github external
# Perform action.
  result = (reconciliation_order_report_service
            .performReconciliationOrderReportAction(
                {'xsi_type': 'SubmitReconciliationOrderReports'},
                statement.ToStatement()))

  if result and result['numChanges'] > 0:
    print('Number of reconciliation order reports submitted: %d' %
          result['numChanges'])
  else:
    print('No reconciliation order reports were submitted.')


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)
github googleads / googleads-python-lib / examples / ad_manager / v201908 / line_item_creative_association_service / update_licas.py View on Github external
# Display results.
      for lica in licas:
        print('LICA with line item id "%s", creative id "%s", and status '
              '"%s" was updated.' % (lica['lineItemId'], lica['creativeId'],
                                     lica['status']))
      statement.offset += statement.limit
    else:
      break

  if response['totalResultSetSize'] == 0:
    print('No LICAs found to update.')

if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)
github googleads / googleads-python-lib / examples / ad_manager / v201905 / creative_set_service / get_all_creative_sets.py View on Github external
statement.ToStatement())
    if 'results' in response and len(response['results']):
      for creative_set in response['results']:
        # Print out some information for each creative set.
        print('Creative set with ID "%d" and name "%s" was found.\n' %
              (creative_set['id'], creative_set['name']))
      statement.offset += statement.limit
    else:
      break

  print('\nNumber of results found: %s' % response['totalResultSetSize'])


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)
github googleads / googleads-python-lib / examples / ad_manager / v201911 / creative_service / create_native_creative.py View on Github external
'value': 'Pie Noon'
          }
      ]
  }

  # Call service to create the creative.
  creative = creative_service.createCreatives([creative])[0]

  # Display results.
  print('Native creative with id "%s" and name "%s" was '
        'created and can be previewed at %s.'
        % (creative['id'], creative['name'], creative['previewUrl']))

if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client, ADVERTISER_ID)
github googleads / googleads-python-lib / examples / ad_manager / v201902 / proposal_line_item_service / create_programmatic_proposal_line_items.py View on Github external
# Add programmatic proposal line items.
  proposal_line_items = proposal_line_item_service.createProposalLineItems(
      [proposal_line_item])

  # Display results.
  for proposal_line_item in proposal_line_items:
    print('Programmatic proposal line item with id "%s", belonging to '
          'proposal id "%s", and named "%s" was created.' %
          (proposal_line_item['id'], proposal_line_item['proposalId'],
           proposal_line_item['name']))


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client, PROPOSAL_ID, PRODUCT_ID, RATE_CARD_ID)
github googleads / googleads-python-lib / examples / ad_manager / v201905 / product_template_service / get_sponsorship_product_templates.py View on Github external
statement.ToStatement())
    if 'results' in response and len(response['results']):
      for product_template in response['results']:
        # Print out some information for each product template.
        print('Product template with ID "%d" and name "%s" was found.\n' %
              (product_template['id'], product_template['name']))
      statement.offset += statement.limit
    else:
      break

  print('\nNumber of results found: %s' % response['totalResultSetSize'])


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)
github googleads / googleads-python-lib / examples / ad_manager / v201905 / proposal_line_item_service / update_proposal_line_items.py View on Github external
# Display results.
    if proposal_line_items:
      for proposal_line_item in proposal_line_items:
        print('Line item with id "%s", belonging to proposal id "%s" and,'
              ' named "%s" was updated.' % (
                  proposal_line_item['id'], proposal_line_item['proposalId'],
                  proposal_line_item['name']))
    else:
      print('No proposal line items were updated.')
  else:
    print('No proposal line items found to update.')


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client, PROPOSAL_LINE_ITEM_ID)
github googleads / googleads-python-lib / examples / ad_manager / v201808 / workflow_request_service / get_workflow_external_condition_requests.py View on Github external
for workflow_request in response['results']:
        # Print out some information for each workflow request.
        print('Workflow request with ID "%d", entity type "%s", and entity ID '
              '"%d" was found.\n' % (workflow_request['id'],
                                     workflow_request['entityType'],
                                     workflow_request['entityId']))
      statement.offset += statement.limit
    else:
      break

  print '\nNumber of results found: %s' % response['totalResultSetSize']


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)
github googleads / googleads-python-lib / examples / ad_manager / v201902 / proposal_line_item_service / create_programmatic_proposal_line_items_for_non_sales_management.py View on Github external
# Add proposal line items.
  proposal_line_items = proposal_line_item_service.createProposalLineItems(
      [proposal_line_item])

  # Display results.
  for proposal_line_item in proposal_line_items:
    print('Programmatic proposal line item for non-sales management with id '
          '"%s", belonging to proposal id "%s", and named "%s" '
          'was created.' % (proposal_line_item['id'],
                            proposal_line_item['proposalId'],
                            proposal_line_item['name']))


if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client, PROPOSAL_ID, PRODUCT_ID)