देखें कि सही स्ट्रीम के लिए api_secret का इस्तेमाल किया जा रहा है या नहीं. अगर एक से ज़्यादा स्ट्रीम के लिए मेज़रमेंट प्रोटोकॉल सेट अप किया जाता है, तो हर स्ट्रीम का अपना पासवर्ड होगा.
स्पैम से बचने के लिए, api_secret को रद्द किया जा सकता है. पक्का करें कि इस्तेमाल किया जा रहा api_secret अब भी मान्य है. ऐसा हो सकता है कि आपकी स्ट्रीम का ऐक्सेस रखने वाले किसी दूसरे व्यक्ति ने गलती से, उसका ऐक्सेस वापस ले लिया हो.
क्या आपने api_secret को सही तरीके से कॉपी किया है?
api_secret केस-सेंसिटिव होता है. दोबारा जांच लें कि Google Analytics के यूज़र इंटरफ़ेस (यूआई) में मौजूद api_secret, कोड में इस्तेमाल किए जा रहे api_secret से एक जैसा है या नहीं.
advertising_id का इस्तेमाल न करें.
advertising_id को मान्य डिवाइस आइडेंटिफ़ायर के तौर पर इस्तेमाल नहीं किया जा सकता. Firebase का इस्तेमाल करने पर app_instance_id और gtag.js का इस्तेमाल करने पर client_id का इस्तेमाल करें.
अमान्य आईडी
मेज़रमेंट प्रोटोकॉल, 'Firebase के लिए Google Analytics' SDK टूल और gtag.js के आईडी के साथ काम करता है. इसलिए, पक्का करें कि आपने सही आईडी का इस्तेमाल किया हो. आपको जिन आईडी का इस्तेमाल करना चाहिए वे इस बात पर निर्भर करते हैं कि 'Firebase के लिए Google Analytics' SDK टूल या gtag.js में से किसका इस्तेमाल किया जा रहा है. यहां बताया गया है कि आपको किन आईडी का इस्तेमाल करना चाहिए:
Firebase के लिए Google Analytics SDK टूल
अगर 'Firebase के लिए Google Analytics' SDK टूल का इस्तेमाल किया जा रहा है, तो इन आईडी का इस्तेमाल किया जाना चाहिए:
firebase_app_id - अनुरोध के लिए क्वेरी पैरामीटर में यह आईडी शामिल करें. यह आईडी, आपके Firebase ऐप्लिकेशन की खास पहचान करता है. आपके ऐप्लिकेशन के सभी उपयोगकर्ताओं के पास एक ही firebase_app_id होगा. Firebase कंसोल में, यहां पाया जा सकता है: प्रोजेक्ट सेटिंग > सामान्य > आपके ऐप्लिकेशन > ऐप्लिकेशन आईडी
app_instance_id - अनुरोध के लिए, पीओएसटी बॉडी में यह आईडी शामिल करें. यह आईडी, Firebase ऐप्लिकेशन के किसी इंस्टॉल की खास पहचान करता है. यह वैल्यू, आपके ऐप्लिकेशन के हर इंस्टॉल के लिए अलग-अलग होगी. हर Firebase प्लैटफ़ॉर्म के लिए इस वैल्यू का अनुरोध करने के तरीके यहां दिए गए हैं:
firebase_instance_id - इस आईडी को आपके अनुरोध में शामिल नहीं करना चाहिए.
इस आईडी का इस्तेमाल, ऐप्लिकेशन के किसी इंस्टेंस की पहचान करने के लिए किया जाता है. हालांकि, यह Firebase के लिए खास तौर पर होता है. इसका इस्तेमाल, FCM मैसेज जैसे टास्क के लिए किया जाता है.
gtag.js
अगर gtag.js का इस्तेमाल किया जा रहा है, तो इन आईडी का इस्तेमाल किया जाना चाहिए:
measurement_id - अनुरोध के लिए क्वेरी पैरामीटर में यह आईडी शामिल करें. इस आईडी से, डेटा स्ट्रीम की खास तौर पर पहचान की जाती है. आपकी वेबसाइट के सभी उपयोगकर्ताओं का measurement_id एक ही होगा. Google Analytics के यूज़र इंटरफ़ेस (यूआई) में, यहां मिलता है: एडमिन > डेटा स्ट्रीम > अपनी स्ट्रीम चुनें > मेज़रमेंट आईडी
client_id - अनुरोध के लिए, पीओएसटी बॉडी में यह आईडी शामिल करें. यह आईडी, किसी वेब क्लाइंट के किसी उपयोगकर्ता इंस्टेंस की खास तौर पर पहचान करता है. यह वैल्यू, आपके ऐप्लिकेशन के हर उपयोगकर्ता के लिए अलग-अलग होगी. इस वैल्यू को वापस पाने का तरीका जानने के लिए, ये उदाहरण देखें.
सर्वर साइड टैगिंग इवेंट मौजूद नहीं हैं
मेज़रमेंट प्रोटोकॉल क्लाइंट के साथ सर्वर-साइड Tag Manager इंस्टॉलेशन की मदद से, किसी कंटेनर में मेज़रमेंट प्रोटोकॉल फ़ॉर्मैट में इवेंट भेजे जा सकते हैं. इसके बाद, कंटेनर उन इवेंट को Google Analytics में भेजता है. इसके लिए, वह उसी तरीके का इस्तेमाल करता है जिसका इस्तेमाल अन्य सभी SGTM इवेंट के लिए किया जाता है.
अगर आपको मेज़रमेंट प्रोटोकॉल की सभी सुविधाएं चाहिए, तो इवेंट को अपने कंटेनर के बजाय सीधे मेज़रमेंट प्रोटोकॉल में भेजें.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis guide helps troubleshoot common Google Analytics 4 Measurement Protocol implementation errors, focusing on missing events and invalid user/device IDs.\u003c/p\u003e\n"],["\u003cp\u003eIf events aren't appearing, ensure your \u003ccode\u003eapi_secret\u003c/code\u003e is correct, valid, accurately copied, and you're using the appropriate device identifier (\u003ccode\u003eapp_instance_id\u003c/code\u003e or \u003ccode\u003eclient_id\u003c/code\u003e, not \u003ccode\u003eadvertising_id\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eWhen using the Measurement Protocol, select the correct IDs based on whether you're implementing via Firebase or gtag.js, as outlined in the guide.\u003c/p\u003e\n"],["\u003cp\u003eFor Firebase, utilize \u003ccode\u003efirebase_app_id\u003c/code\u003e and \u003ccode\u003eapp_instance_id\u003c/code\u003e, avoiding \u003ccode\u003efirebase_instance_id\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor gtag.js, use \u003ccode\u003emeasurement_id\u003c/code\u003e and \u003ccode\u003eclient_id\u003c/code\u003e for proper event tracking.\u003c/p\u003e\n"]]],["To resolve event visibility issues in Google Analytics, verify the correct `api_secret` is used, valid, and copied accurately, and avoid using `advertising_id`. For Firebase, use `firebase_app_id` in query parameters and `app_instance_id` in the POST body; retrieve `app_instance_id` using the appropriate platform's method. For gtag.js, utilize `measurement_id` in query parameters and `client_id` in the POST body. Both `client_id` and `app_instance_id` should differ for each user.\n"],null,["# Troubleshooting\n\nThis guide outlines common troubleshooting steps to fix common implementation\nerrors.\n\nNo events\n---------\n\nIf your events aren't showing up in Google Analytics, there are a few common\nissues you should look for.\n\nFirst choose your client: \nFirebase gtag.js\n\n\u003cbr /\u003e\n\n- Are you using the correct [api_secret](/analytics/devguides/collection/protocol/ga4/reference#api_secret)?\n\n Check that you're using the `api_secret` for the right stream. If you set up\n the measurement protocol for multiple streams, each stream will have its own\n secret.\n- Is your [api_secret](/analytics/devguides/collection/protocol/ga4/reference#api_secret) still valid?\n\n In order to help combat spam, you're able to revoke `api_secret`s. Make sure\n that the `api_secret` you are using is still valid. It's possible that\n another user with access to your stream may have revoked access to it by\n mistake.\n- Is your [api_secret](/analytics/devguides/collection/protocol/ga4/reference#api_secret) copied correctly?\n\n `api_secret` is case-sensitive. Double check that the `api_secret` in the\n Google Analytics UI is *exactly* the same as the one you're using in your\n code.\n- Don't use `advertising_id`.\n\n `advertising_id` is not supported as a valid device identifier. Use\n `app_instance_id` if you're using Firebase and `client_id` if you're using\n gtag.js.\n\nInvalid IDs\n-----------\n\nSince the Measurement Procotol supports IDs from the Google Analytics for\nFirebase SDK and gtag.js, make sure you use the right ID. **The IDs you should\nuse changes depending on whether you are using the Google Analytics for Firebase\nSDK or gtag.js.** The following outlines which IDs you should be using:\n\n**Google Analytics for Firebase SDK**\n\nIf you're using the Google Analytics for Firebase SDK the IDs you *should* use\nare:\n\n- [`firebase_app_id`](/analytics/devguides/collection/protocol/ga4/reference?client_type=firebase#firebase_app_id) - Include this ID in the query parameters for the request. This ID uniquely identifies your Firebase App. All users of your app will have the same `firebase_app_id`. Found in the Firebase console under: \n **Project Settings** \\\u003e **General** \\\u003e **Your Apps** \\\u003e **App ID**\n- [`app_instance_id`](/analytics/devguides/collection/protocol/ga4/reference?client_type=firebase#app_instance_id) - Include this ID in the POST body for the request. This\n ID uniquely identifies a given installation of a Firebase App. This value\n will be different for every installation of your app. The methods to request\n this value for each Firebase platform are as follows:\n\n - [Android - getAppInstanceId()](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics#public-taskstring-getappinstanceid)\n - [Kotlin - getAppInstanceId()](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/analytics/FirebaseAnalytics#getappinstanceid)\n - [Swift - appInstanceID()](https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Classes/Analytics#appinstanceid)\n - [Objective-C - appInstanceID](https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Classes/FIRAnalytics#+appinstanceid)\n - [C++ - GetAnalyticsInstanceId()](https://firebase.google.com/docs/reference/cpp/namespace/firebase/analytics#getanalyticsinstanceid)\n - [Unity - GetAnalyticsInstanceIdAsync()](https://firebase.google.com/docs/reference/unity/class/firebase/analytics/firebase-analytics#getanalyticsinstanceidasync)\n\nYou should *not* use the following:\n\n- `firebase_instance_id` - This ID *should not* be included in your request. This ID is used for identifiying a given instance of the app, but is Firebase specific. It's used for tasks such as FCM messages.\n\n**gtag.js**\n\nIf you're using gtag.js, the IDs you *should* use are:\n\n- [`measurement_id`](/analytics/devguides/collection/protocol/ga4/reference?client_type=gtag#measurement_id) - Include this ID in the query parameters for the request. This ID uniquely identifies a Data Stream. All users of your website will have the same `measurement_id`. Found in the Google Analytics UI under: \n **Admin** \\\u003e **Data Streams** \\\u003e **choose your stream** \\\u003e **Measurement ID**\n- [`client_id`](/analytics/devguides/collection/protocol/ga4/reference?client_type=gtag#client_id) - Include this ID in the POST body for the request. This ID uniquely identifies a given user instance of a web client. This value will be different for every user of your app. See [these examples](/gtagjs/reference/api#get) for how to retrieve this value.\n\nServer-side tagging events missing\n----------------------------------\n\nA [Server-side Tag Manager installation with a Measurement Protocol\nclient](/tag-platform/tag-manager/server-side/send-data#server-to-server_apps) lets you send events in the Measurement Protocol *format* to a\ncontainer. The container then sends those events to Google Analytics using the\nsame mechanism as all other SGTM events.\n| **Note:** It *doesn't* send those events to the Measurement Protocol endpoint, and therefore doesn't support all the features of the Measurement Protocol endpoint, such as deriving [geographic and device information](/analytics/devguides/collection/protocol/ga4#geo_device) from tagging events.\n\nIf you want all the features of the Measurement Protocol, send events directly to the\nMeasurement Protocol instead of your container."]]