# Create a New Campaign

#### Advertising channel type

{% file src="<https://2592634121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT5HLPrqZhkeNGgJP37dC%2Fuploads%2FovOoIZ9Kc6i8f9wYOFsQ%2FAdvertisingChannelType.json?alt=media&token=bace5c32-a6eb-4b24-a7fd-5b25a78d7487>" %}

{% file src="<https://2592634121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT5HLPrqZhkeNGgJP37dC%2Fuploads%2FzIXVQSWy407zD6c0DHMj%2FCampaignAdvertisingChannelType.json?alt=media&token=8fb2e336-86f9-443c-a44e-9a57a38a8788>" %}

{% file src="<https://2592634121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT5HLPrqZhkeNGgJP37dC%2Fuploads%2FatZzoPuaxMwLqjOH2cPJ%2FCampaignStatusEnum.json?alt=media&token=08a6caa8-202b-4a29-ae58-728a2d04fab0>" %}

<details>

<summary>Body JSON</summary>

```shell
{
  "id": "140",
  "campaign_name": "Website traffic-Display-27",
  "advertising_channel_type": 2,
  "status": 2,
  "start_date": "20230125",
  "end_date": "20230129"
}
```

</details>

<mark style="color:green;">`POST`</mark> `https://us-central1-appgregator.cloudfunctions.net/googleads/campaigns/`

#### Query Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4        |
| connection\_name<mark style="color:red;">\*</mark> | String | ga-06       |
| customer\_id<mark style="color:red;">\*</mark>     | String | 8171576147  |

#### Headers

| Name                                                | Type   | Description                          |
| --------------------------------------------------- | ------ | ------------------------------------ |
| client\_id<mark style="color:red;">\*</mark>        | String | XXXX-XXXX.apps.googleusercontent.com |
| client\_secret<mark style="color:red;">\*</mark>    | String | XXXX-XXXX                            |
| login-customer-id<mark style="color:red;">\*</mark> | String | 1894250756                           |
| developer\_token<mark style="color:red;">\*</mark>  | String | XXXX                                 |
| x-api-key<mark style="color:red;">\*</mark>         | String | U2Fsd...                             |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
[
    {
        "campaign_id": 19557665715,
        "campaign_name": "campaign 1",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-14",
        "campaign_end_date": "2023-02-13",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12276388739",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19576421691,
        "campaign_name": "Website traffic-Display-8",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-19",
        "campaign_end_date": "2023-02-18",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12288077171",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19583888399,
        "campaign_name": "Website traffic-Display-4",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-19",
        "campaign_end_date": "2023-02-18",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12301017241",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19583901278,
        "campaign_name": "Website traffic-Display-5",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-19",
        "campaign_end_date": "2023-02-18",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12292532124",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19583903711,
        "campaign_name": "Website traffic-Display-6",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-19",
        "campaign_end_date": "2023-02-18",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12292533312",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19583927983,
        "campaign_name": "Website traffic-Display-7",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-19",
        "campaign_end_date": "2023-02-18",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12287804597",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587260377,
        "campaign_name": "Website traffic-Display-9",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12294788826",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587260578,
        "campaign_name": "Website traffic-Display-11",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12289984277",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587286465,
        "campaign_name": "Website traffic-Display-13",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12294808920",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587297526,
        "campaign_name": "Website traffic-Display-16",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12290008469",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587302365,
        "campaign_name": "Website traffic-Display-17",
        "campaign_status": 2,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12303237490",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587321766,
        "campaign_name": "Website traffic-Display-22",
        "campaign_status": 2,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-01-25",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12294836796",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587482579,
        "campaign_name": "Website traffic-Display-15",
        "campaign_status": 3,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12294811821",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587491186,
        "campaign_name": "Website traffic-Display-18",
        "campaign_status": 2,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12294819723",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587496211,
        "campaign_name": "Website traffic-Display-19",
        "campaign_status": 2,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12303243247",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19587496955,
        "campaign_name": "Website traffic-Display-20",
        "campaign_status": 2,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-20",
        "campaign_end_date": "2023-02-19",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 3,
        "campaign_budget": "customers/8171576147/campaignBudgets/12290019308",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    },
    {
        "campaign_id": 19604013004,
        "campaign_name": "Website traffic-Search-appgregator",
        "campaign_status": 2,
        "campaign_advertising_channel_type": 2,
        "campaign_start_date": "2023-01-23",
        "campaign_end_date": "2037-12-30",
        "campaign_bidding_strategy": "",
        "campaign_bidding_strategy_type": 10,
        "campaign_budget": "customers/8171576147/campaignBudgets/12305416977",
        "campaign_manual_cpa": null,
        "campaign_metrics_clicks": 0,
        "campaign_metrics_cost_micros": 0,
        "campaign_metrics_ctr": 0,
        "campaign_metrics_conversions": 0,
        "campaign_metrics_average_cpc": 0,
        "campaign_metrics_interactions": 0,
        "campaign_metrics_interaction_rate": 0,
        "campaign_metrics_all_conversions": 0,
        "campaign_metrics_cost_per_conversion": 0,
        "campaign_metrics_impressions": 0
    }
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="NodeJs  - Axios" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "id": "140",
  "campaign_name": "Website traffic-Display-27",
  "advertising_channel_type": 2,
  "status": 2,
  "start_date": "20230125",
  "end_date": "20230129"
});

var config = {
  method: 'post',
  url: 'https://us-central1-appgregator.cloudfunctions.net/googleads/campaigns?name=ft-4&connection_name=ga-06&customer_id=8171576147',
  headers: { 
    'login-customer-id': '1894250756', 
    'client_id': 'XXX-XXX.apps.googleusercontent.com', 
    'client_secret': 'XXX-XXX', 
    'developer_token': 'XXX', 
    'x-api-key': 'U2FsdG...', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="cURL" %}

```shell
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/googleads/campaigns?name=ft-4&connection_name=ga-06&customer_id=8171576147' \
--header 'login-customer-id: 1894250756' \
--header 'client_id: XXX-XXX.apps.googleusercontent.com' \
--header 'client_secret: XXX-XXX' \
--header 'developer_token: XXX' \
--header 'x-api-key: U2FsdG...' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id" : "140",
    "campaign_name" : "Website traffic-Display-27",
    "advertising_channel_type" : 2,
    "status" : 2,
    "start_date" : "20230125",
    "end_date" : "20230129"

}'
```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/googleads/campaigns?name=ft-4&connection_name=ga-06&customer_id=8171576147',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "id" : "140",
    "campaign_name" : "Website traffic-Display-27",
    "advertising_channel_type" : 2,
    "status" : 2,
    "start_date" : "20230125",
    "end_date" : "20230129"

}',
  CURLOPT_HTTPHEADER => array(
    'login-customer-id: 1894250756',
    'client_id: XXX-XXX.apps.googleusercontent.com',
    'client_secret: XXX-XXX',
    'developer_token: XXX',
    'x-api-key: U2FsdG...',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
