- 19 Nov 2019
- 2 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
Google Ads
- Updated on 19 Nov 2019
- 2 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
# Google Ads
- Start work with AdWords
- Getting developer's token
- Getting Google OAuth 2.0 access_token
- Setting up tokens in Config state diagram
- Object description in AdWords folder
Start work with Google Ads
Copy AdWords folder to your environment.
In order to work wth AdWords API you need account details and Google OAuth 2.0 token.
Getting developer's token
Create your separate (control) account, get its ID and developer's token.
- clientCustomerId - you account ID.
Copy it from upper right corner in AdWords account.
You have to specify account ID where the companies run, not the control account ID, where you got the token.
- developerToken - developer's token.
In order to get it, use tutorial.
Getting Google OAuth 2.0 access_token
1) Configure the processes and get the access_token
, as described in the [OAuth Authentication]( / docs / google-oauth) with one difference from the instructions in section 8:
Create an application for access_token with ** Reference = adwords **
2) Copy the ID of the Token Storage
state diagram from the information block of its start node.
We will need this value below.
Setting up tokens in Config state diagram
1) Go to View
mode of Config state diagram and press New task
2) Fill up next parameters:
- Reference = config
- clientCustomerId - you account ID
- developerToken - developer's token
- state_diagram_id -
State token
diagram ID Google OAuth 2.0
3) Press Add task
Now all required parameters for autorization in AdWords API are set and ready for getiing their values from other processes.
Description of objects in AdWords folder.
State diagram Config - autorization data storage
Process Get campaings - getting companies list
There are no incoming parameters
Outcoming parameters "success":
array
- json array with request result
Outcoming parameters "error":
code
- error code
Process Report - getting reports
Incoming parameters:
reportType
- report type
Outcoming parameters "success":
array
- json array with request result
Outcoming parameters "error":
code
- error code
Folder AdGroupService - ad group control
Process adGroup - GET by CampaignId - getting ad group list by company ID
Incoming parameters:
CampaignId
- company id
Outcoming parameters "success":
array
- json array with request result
Outcoming parameters "error":
code
- error codefaultstring
- error text
Folder AdGroupService - ad group management
Process adGroup - UPDATE - status change by ad group
Incoming parameters:
adGroupId
- group idstatus
- group new status
Outcoming parameters "success":
result
- new status
Outcoming parameters "error":
code
- error codefaultstring
- error text
Folder AdGroupAdService - ad management
Process AD - GET by AdGroupId - getting ad list by ad group ID
Incoming parameters:
adGroupId
- group id
Outcoming parameters "success":
array
- json array with request result
Outcoming parameters "error":
code
- error codefaultstring
- error text
Folder AdGroupAdService - ad management
Process AD - UPDATE - status change by ad
Incoming parameters:
adGroupId
- group idstatus
- ad new statusadId
- ad id
Outcoming parameters "success":
result
- new status
Outcoming parameters "error":
code
- error codefaultstring
- error text