# OAuth Google

## Bước 1/ Tạo Project mới trên Google Cloud

* Truy cập link: <https://console.cloud.google.com/>
* Chọn "New Project"
* Điền thông tin khởi tạo cho New Project
* Chọn "Creat" để khởi tạo và nhận được Notification hoàn tất

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FphmXkbA8OXOFSH6JfE9p%2Fimage.png?alt=media&#x26;token=38630fd9-3dde-4472-a8f7-1fe3b2fed4c0" alt=""><figcaption></figcaption></figure>

| Trường thông tin | Mô tả                                                                                                                                                               |   |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| Project name     | đặt tên Project                                                                                                                                                     |   |
| Organization     | điền Domain là đuôi email của doanh nghiệp mà được dùng để Log-in.  Ví dụ: bạn log-in với email haic&#x74;**@bytetech.io** thì Domain là đuổi email **bytetech.io** |   |
| Location         | tự động điền Domain là đuôi email của doanh nghiệp                                                                                                                  |   |

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FLU8g6ClCQfRAGYLCaYKn%2Fimage.png?alt=media&#x26;token=b36bf6ca-6f08-4520-9332-258ec11ba1b5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2F0WtL2Cw6wH1mYUlmboXo%2Fimage.png?alt=media&#x26;token=b989f23b-acc5-4412-a6d0-0912af644b41" alt=""><figcaption></figcaption></figure>

## Bước 2/ Tạo API Libabry trên Google Cloud

* Truy cập link: <https://console.cloud.google.com/>
* Chọn Project mới vừa được tạo
* Chọn "API & Services"&#x20;
* Chọn "Library"&#x20;
* Tại màn hình API Library, gõ "google ads api" để tìm kiếm
* Chọn Google Ads Api / "Enable" để hoàn tất

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FjtOIW6xa2XJHgXyqcUI6%2Fimage.png?alt=media&#x26;token=07f4aee6-da2e-471c-aaba-e909ccb08f33" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FkoO0Qqlqy4xXS0Gc4fU6%2Fimage.png?alt=media&#x26;token=d43a37fb-0911-47a3-aad5-54b2572a398d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FWpGFhDAav3iUBuppHk9a%2Fimage.png?alt=media&#x26;token=7180de20-386b-4619-80a1-f4153c20ab03" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FDfdZQOh3qx5rAhzDq5nc%2Fimage.png?alt=media&#x26;token=1a179e58-e10f-4c6f-a1c0-f8e1740d1d9f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2Fb7DEqktLlKIWJ0lWiNgU%2Fimage.png?alt=media&#x26;token=b82ae1c1-3466-44f8-9e59-4780f2f14a7f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FwTChszzm4GdvI02qPjLo%2Fimage.png?alt=media&#x26;token=736b7945-a082-4936-bbc5-b13fc11795e5" alt=""><figcaption></figcaption></figure>

## Bước 3/ Tạo OAuth Consent Screen trên Google Cloud

* Truy cập link: <https://console.cloud.google.com/>
* Chọn Project mới vừa được tạo
* Chọn "API & Services"&#x20;
* Chọn "OAuth consent screen" / "Internal" / "Create"
* Nhập thông tin để tạo App
* Chọn "Save And Continue"

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FcfngyMJdnRgXtIWPw9nL%2Fimage.png?alt=media&#x26;token=07b33d65-06f7-48a5-a9cd-81b746a1d7d5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FqlyYN1dXt3jWTgZZOSEg%2Fimage.png?alt=media&#x26;token=4e021b38-a933-4863-9575-275fb1bbe4de" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FKnbR0QBBdPU0PJRMk6bG%2Fimage.png?alt=media&#x26;token=c4297b35-d51a-4d5f-ab6e-73faafffd843" alt=""><figcaption></figcaption></figure>

## Bước 4/ Tạo Scopes cho OAuth Consent Screen

* Tại màn hình [OAuth Consent Screen / Scopes](https://console.cloud.google.com/apis/credentials/consent/edit?project=org-digital-gg-ads)
* Chọn "ADD OR REMOVE SCOPES"
* Chọn full quyền và "UPDATE"
* Chọn "Save And Continue" để hoàn thành

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FtbH1Q3szd8LGlCADYKNn%2Fimage.png?alt=media&#x26;token=60301b99-1ab9-4827-a1ff-b43f1804a5a9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FxziFFXw5vsXYTO2R5IO4%2Fimage.png?alt=media&#x26;token=b631b7ac-1cb6-417e-83a5-9d6303ef90b4" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2F1r72IeL1rnt9jrIycEX9%2Fimage.png?alt=media&#x26;token=7ac827bd-a4f3-496f-a9ef-724ac89aa03d" alt=""><figcaption></figcaption></figure>

## Bước 5/ Tạo Credentials trên Google Cloud

* Tại màn hình [API & Services](https://console.cloud.google.com/apis/credentials?project=org-digital-gg-ads)
* Chọn Credentials /  "+ Create Credentials"
* Chọn OAuth client ID
* Điền các thông tin và chọn "CREATE" để hoàn thành
* Lưu lại tất cả các thông tin và download file JSon

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FGNhTeoiBKP1uljfRufPO%2Fimage.png?alt=media&#x26;token=ed871506-7c64-4f8d-8935-d4416a940aa0" alt=""><figcaption></figcaption></figure>

| Trường thông tin              | Mô tả                                                                                          |
| ----------------------------- | ---------------------------------------------------------------------------------------------- |
| Application type              | chọn loại App. Ở đây mình dùng link truy cập nên chọn Web application                          |
| Name                          | tên sẽ hiển thị khi xác thực tài khoản                                                         |
| Authorized JavaScript origins | <p>link call Javacript IP như sau: <a href="https://mydatalakes.com"><https://mydatalakes.com> |
| <br></a></p>                  |                                                                                                |
| Authorized redirect URIs      | link call back API như sau: <https://console.mydatalakes.com/auth/google/ads/callback>         |

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FWuDVbarmKRm3OVAnSbLP%2Fimage.png?alt=media&#x26;token=065bc06d-d208-423e-be68-5aa110fdc844" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FGoQDdeK8zCaIu25fzn6x%2Fimage.png?alt=media&#x26;token=7053fc23-56b1-4d95-af58-10d0612f96a0" alt=""><figcaption></figcaption></figure>

## Bước 6/ Tạo OAuth Google Ads Connection

* Vào [Module Console](https://console.mydatalakes.com/oauth)
* Chọn OAuth / Advertising / Google Ads
* Chọn "+ Connect" / "Agree to enable the service" / Enable
* Chọn "+ App Config"
* Chọn "+ Add"
* Điền các thông tin Project ID / Client ID / Client secret đã được tạo trên Google Cloud / Status = Approved
* Chọn "Save & Close" để hoàn thành

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2Fx1lJBBKSY92FGtjydVEJ%2Fimage.png?alt=media&#x26;token=ba65dd9f-44a1-4208-a962-7df8d697bcf5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FLwRV56lvdbbZv7BGuh0q%2Fimage.png?alt=media&#x26;token=d244dbff-06ff-4950-b615-b59680c17d8c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FSVmzRjP37rrSYOPpY8py%2Fimage.png?alt=media&#x26;token=628afac3-7609-4e41-8671-0c303756f35b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FKLAeHqFTuh6vbfEuuQy8%2Fimage.png?alt=media&#x26;token=a2328ff7-b306-43d1-b51c-417b78c3f23c" alt=""><figcaption></figcaption></figure>

## Bước 7/ Xác thực tài khoản Google Ads cùng Domain

* Vào [Module Console](https://console.mydatalakes.com/oauth)
* Chọn OAuth / Advertising / Google Ads
* Chọn "+ App Config"
* Chọn connection đã tạo /  "+ Select"
* Chọn tài khoản Email đã tạo tài khoản Google Ads trên Google Cloud
* Chọn "Continue" để cấp quyền truy cập vào Project Google Ads được tạo
* Chọn "Allow" để đồng ý tài khoản được tạo và chỉnh sửa thông tin khi chạy Google Ads để hoàn tất

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FOiNNMnuSLOhEnwMpfCxy%2Fimage.png?alt=media&#x26;token=477a9a7e-f965-433e-9609-e3a81ef8dfb5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FC0MjK0V3FzFOTzaxEcka%2Fimage.png?alt=media&#x26;token=832a813b-0914-49bb-974d-350ae5f61202" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FBW4zWGGPt05JBfUOZdzr%2Fimage.png?alt=media&#x26;token=1f0493cd-1653-4821-910a-0260a29785f8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FiiLXRi9KWsuoqRWOJbRJ%2Fimage.png?alt=media&#x26;token=4091e72a-e84a-4649-8369-e3197ec85869" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3611282794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMnAYUMyvVmco94ZeJ3T3%2Fuploads%2FKEUo5muZUFFDF81X5FRn%2Fimage.png?alt=media&#x26;token=411eae2f-f5af-4d8e-8509-c9ce48b4d414" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.pangocdp.com/user-guide/module-console/authentication/oauth-google.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
