In this walkthrough, you'll generate OAuth credentials in preparation for the deployment of DG-Pulse.
GCP organizes resources into projects. This allows you to collect all of the related resources for a single application in one place.
Begin by creating a new project or selecting an existing project for this dashboard.
For details, see Creating a project.
Enable the Google Ads API and the BigQuery API so that they're incorporated in the credentials you will generate in the next step.
First, let's switch off your shell's ephemeral mode.
Click More and look for the Ephemeral Mode
option. If it is turned on turn it off. This allows the dashboard code to persist across sessions.
Copy the following command into the shell, press enter and follow the instructions:
cd
git clone https://github.com/google-marketing-solutions/dgpulse.git
cd dgpulse
gcloud auth login
An authorization token is needed for the dashboard to communicate with Google Ads.
-
Go to the APIs & Services > OAuth consent screen page in the Cloud Console. You can use the button below to find the section.
-
Choose External as the user type for your application.
- If you have an organization for your application, select Internal.
- If you don't have an organization configured for your application, select External.
-
Click Create to continue.
-
Under App information, enter the Application name you want to display. You can copy the name below and enter it as the application name.
DemandGen-Pulse
-
For the Support email dropdown menu, select the email address you want to display as a public contact. This email address must be your email address, or a Google Group you own.
-
Under Developer contact information, enter a valid email address.
Click Save and continue.
Scope the consent screen for Big Query API and the Google Ads API.
- Click Add or remove scopes
- Now in Enter property name or value search for the BigQuery API, check the box for the first option to choose it.
- Do the same for Google Ads API.
- Click Update
Create the credentials that are needed for generating a refresh token.
Make sure to copy each of the credentials you create, you will need them later.
-
On the APIs & Services page, click the Credentials tab.
-
On the Create credentials drop-down list, select OAuth client ID.
-
Under Application type, select Web application.
-
Add a Name for your OAuth client ID.
-
Click Authorized redirect URI and copy the following:
https://developers.google.com/oauthplayground
-
Click Create. Your OAuth client ID and client secret are generated and displayed on the OAuth client window.
After generating the client_id and client_secret keep the confirmation screen open and go to the next step.
-
Go to the OAuth2 Playground (opens in a new window)
-
On the right-hand pane, paste the client_id and client_secret in the appropriate fields
-
Then on the left hand side of the screen, click the blue Authorize APIs button
If you are prompted to authorize access, please choose your Google account that has access to Google Ads and approve.
-
Now, click the new blue button Exchange authorization code for tokens
-
Finally, in the middle of the screen you'll see your refresh token on the last line. Copy it and save it for future reference. Do not copy the quotation marks
Use this link to access the group URL and click on "Join Group"
Run the following command and follow the steps:
sh install-or-upgrade.sh
Congratulations. You've set up DG-Pulse!