Ask Tham khảo API của Google Adsense

## Cách sử dụng API Google AdSense

API Google AdSense cho phép bạn quản lý tài khoản AdSense của mình.Bạn có thể sử dụng API để tạo các chiến dịch, thêm quảng cáo vào trang web của bạn và theo dõi thu nhập của bạn.

Để bắt đầu với API Google Adsense, bạn cần tạo một dự án trong bảng điều khiển của Google Developers.Khi bạn đã tạo một dự án, bạn có thể tạo khóa API.

Để sử dụng API, bạn cần đưa khóa API của mình vào yêu cầu của mình.Bạn có thể làm điều này bằng cách đặt tiêu đề `ủy quyền` thành` bearer your_api_key`.

API Google AdSense được ghi lại trên trang web [trang web của Google Developers] (https://developers.google.com/adsense/api/v2/).

Dưới đây là một số ví dụ về cách bạn có thể sử dụng API Google AdSense:

* Tạo một chiến dịch:

`` `
Đăng https://adsense.googleapis.com/v2/accounts/1234567890/campaigns
{
"Tên": "Chiến dịch đầu tiên của tôi",
"Status": "đã kích hoạt",
"Nhắm mục tiêu": {
"GEOTARETING": {
"TargetGedeos": [
"CHÚNG TA",
"CA"
]
}
}
}
`` `

* Thêm một quảng cáo vào trang web của bạn:

`` `
Đăng https://adsense.googleapis.com/v2/accounts/1234567890/adunits
{
"Tên": "Đơn vị quảng cáo đầu tiên của tôi",
"Adcode": "CA-PUB-1234567890123456",
"Nhắm mục tiêu": {
"GEOTARETING": {
"TargetGedeos": [
"CHÚNG TA",
"CA"
]
}
}
}
`` `

* Theo dõi thu nhập của bạn:

`` `
Nhận https://adsense.googleapis.com/v2/accounts/1234567890/reports/earnings
`` `

Để biết thêm thông tin, vui lòng xem [tài liệu API của Google AdSense] (https://developers.google.com/adsense/api/v2/).

## hashtags

* #google Adsense
* #API
* #Programming
* #phát triển web
* #Tiếp thị
=======================================
## How to Use the Google Adsense API

The Google Adsense API allows you to programmatically manage your Adsense account. You can use the API to create campaigns, add ads to your website, and track your earnings.

To get started with the Google Adsense API, you need to create a project in the Google Developers Console. Once you have created a project, you can generate an API key.

To use the API, you need to include your API key in your requests. You can do this by setting the `Authorization` header to `Bearer YOUR_API_KEY`.

The Google Adsense API is documented on the [Google Developers website](https://developers.google.com/adsense/api/v2/).

Here are some examples of how you can use the Google Adsense API:

* Create a campaign:

```
POST https://adsense.googleapis.com/v2/accounts/1234567890/campaigns
{
"name": "My First Campaign",
"status": "ENABLED",
"targeting": {
"geoTargeting": {
"targetedGeos": [
"US",
"CA"
]
}
}
}
```

* Add an ad to your website:

```
POST https://adsense.googleapis.com/v2/accounts/1234567890/adunits
{
"name": "My First Ad Unit",
"adCode": "ca-pub-1234567890123456",
"targeting": {
"geoTargeting": {
"targetedGeos": [
"US",
"CA"
]
}
}
}
```

* Track your earnings:

```
GET https://adsense.googleapis.com/v2/accounts/1234567890/reports/EARNINGS
```

For more information, please see the [Google Adsense API documentation](https://developers.google.com/adsense/api/v2/).

## Hashtags

* #Googleadsense
* #API
* #Programming
* #webdevelopment
* #marketing
 
Join ToolsKiemTrieuDoGroup
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock