> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# इनसाइट्स

> अपने अभियानों, ऐड ग्रुप या विज्ञापनों के लाइव दैनिक Google Ads मेट्रिक्स पाएँ, क्लिक, लागत, कन्वर्ज़न और कन्वर्ज़न मूल्य के साथ।

Ayrshare के माध्यम से बनाए गए अभियानों, ऐड ग्रुप या विज्ञापनों के लिए लाइव Google Ads प्रदर्शन पाएँ, प्रति दिन एक पंक्ति।

<ul>
  <li>संख्याएँ आपके कॉल करने पर सीधे Google से पढ़ी जाती हैं, किसी रात्रिकालीन कॉपी से नहीं।</li>
  <li>सभी मौद्रिक मूल्य विज्ञापन खाते की मुद्रा में हैं, जो प्रत्येक पंक्ति में `currency` में लौटाई जाती है।</li>
  <li>Google बिना किसी गतिविधि वाले दिनों को छोड़ देता है, इसलिए किसी अवधि के लिए उसके दिनों से कम पंक्तियाँ लौट सकती हैं।</li>
  <li>Google किसी दिन के खत्म होने के कुछ दिनों बाद तक उस दिन की लागत और कन्वर्ज़न को समायोजित करता है, इसलिए हाल के दिनों के आँकड़े अलग-अलग बार पढ़ने पर बदल सकते हैं।</li>
  <li>Performance Max अभियान के लिए, अभियान id के साथ `level=campaign` का उपयोग करें। Performance Max अभियान के अपने कोई विज्ञापन नहीं होते, इसलिए `level=ad` कोई पंक्ति नहीं लौटाता।</li>
</ul>

## हेडर पैरामीटर

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## क्वेरी पैरामीटर

**level** `string` *required*

प्रत्येक पंक्ति किस पर रिपोर्ट करती है: `campaign` (Create से मिला `campaignId`), `adSet` (Create से मिला `adGroupId`) या `ad` (Create से मिला `adId`)।

**ids** `string` *required*

अल्पविराम से अलग की गई अभियान, ऐड ग्रुप या विज्ञापन ID, अधिकतम 50। सभी एक ही विज्ञापन खाते में होनी चाहिए।

**accountId** `string`

10 अंकों की Google Ads customer id, हाइफ़न के साथ या बिना (`123-456-7890`)।

विज्ञापन और ऐड ग्रुप रिपोर्ट उस विज्ञापन खाते को पढ़ती हैं जिसे आप यहाँ बताते हैं। इसके बिना, विज्ञापन रिपोर्ट उन सभी विज्ञापन खातों में खोजती है जहाँ तक आपका Google Ads लिंक पहुँचता है, अधिकतम 25 तक, और ऐड ग्रुप रिपोर्ट केवल तभी काम करती है जब आपका लिंक एक ही विज्ञापन खाते तक पहुँचता हो। जब आपका लिंक 25 से अधिक विज्ञापन खातों तक पहुँचता हो, या ऐड ग्रुप रिपोर्ट के लिए एक से अधिक खातों तक, तो खाते का नाम बताएँ। अन्यथा अनुरोध `code: 101` लौटाता है।

**metrics** `string`

लौटाए जाने वाले मेट्रिक्स, अल्पविराम से अलग किए गए। सभी पाने के लिए इसे छोड़ दें। [मेट्रिक्स](#metrics) देखें।

**startDate** `string` (default: 30 दिन पहले)

पहला दिन, `YYYY-MM-DD` के रूप में। Google दैनिक आँकड़े 37 महीनों तक रखता है; इससे पुरानी `startDate` पर `code: 101` लौटता है।

**endDate** `string` (default: आज)

आख़िरी दिन, `YYYY-MM-DD` के रूप में।

## मेट्रिक्स

| मेट्रिक | प्रकार | अर्थ |
| - | - | - |
| `spend` | number | खर्च की गई राशि |
| `impressions` | number | विज्ञापन कितनी बार दिखाया गया |
| `clicks` | number | क्लिक |
| `cpm` | number या `null` | प्रति 1,000 इंप्रेशन लागत। बिना इंप्रेशन वाले दिन `null` |
| `cpc` | number या `null` | प्रति क्लिक लागत। बिना क्लिक वाले दिन `null` |
| `ctr` | number या `null` | क्लिक-थ्रू दर, प्रतिशत में। बिना इंप्रेशन वाले दिन `null` |
| `actions` | number | Google के कन्वर्ज़न, जो भिन्नात्मक हो सकते हैं |
| `conversionValue` | number | उन कन्वर्ज़न का मूल्य |

जब तक आपके Google Ads खाते में कन्वर्ज़न ट्रैकिंग सेट अप नहीं होती, `actions` और `conversionValue` `0` रहते हैं। `reach` उपलब्ध नहीं है, क्योंकि Google, Search के लिए कोई यूनिक reach रिपोर्ट नहीं करता, और Google पर `breakdowns` उपलब्ध नहीं हैं। इनमें से किसी को भी माँगने पर `code: 101` लौटता है।

## पेजिंग

हर पंक्ति एक ही रिस्पॉन्स में लौटती है, इसलिए `nextCursor` हमेशा `null` होता है।

## त्रुटियाँ

| कोड | कब |
| - | - |
| `101` | कोई पैरामीटर अनुपस्थित या गलत है, कोई मेट्रिक या ब्रेकडाउन समर्थित नहीं है, `startDate` 37 महीने से अधिक पहले का है, 50 से अधिक ID भेजी गई हैं, ID एक से अधिक विज्ञापन खातों में हैं, या `accountId` आवश्यक है और नहीं भेजा गया |
| `400` | कोई अभियान, ऐड ग्रुप या विज्ञापन आपका नहीं है, या `accountId` वह विज्ञापन खाता नहीं है जो Ayrshare के रिकॉर्ड में आपके द्वारा भेजी गई ID के लिए दर्ज है |
| `370` | Google इनसाइट्स नहीं लौटा सका। फिर से प्रयास करें |

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07"
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${API_KEY}`
  }
})
  .then((res) => res.json())
  .then((json) => console.log(json))
  .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {
    "Authorization": "Bearer API_KEY",
}

r = requests.get("https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07", headers=headers)

print(r.json())
```

```php PHP theme={"system"}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer API_KEY"
    ]
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error: " . $err;
} else {
    echo $response;
}
?>
```

```csharp C# theme={"system"}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");

        var response = await client.GetAsync("https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07");
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}
```

```go Go theme={"system"}
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07", nil)
    req.Header.Add("Authorization", "Bearer API_KEY")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```java Java theme={"system"}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class GetAdInsights {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07"))
            .header("Authorization", "Bearer API_KEY")
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
```

```ruby Ruby theme={"system"}
require 'net/http'
require 'uri'

uri = URI.parse('https://api.ayrshare.com/api/ads/google/insights?level=campaign&ids=21534567890&startDate=2026-10-01&endDate=2026-10-07')

request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "platform": "google",
  "level": "campaign",
  "startDate": "2026-10-01",
  "endDate": "2026-10-07",
  "insights": [
    {
      "date": "2026-10-01",
      "level": "campaign",
      "id": "21534567890",
      "currency": "USD",
      "spend": 12.48,
      "impressions": 1830,
      "clicks": 41,
      "cpm": 6.82,
      "cpc": 0.3,
      "ctr": 2.2404,
      "actions": 3.5,
      "conversionValue": 140
    }
  ],
  "count": 1,
  "nextCursor": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.