Google Analytics-এর জন্য MCP সার্ভার ব্যবহার করে দেখুন।
GitHub থেকে ইনস্টল করুন এবং আরও বিশদ বিবরণের জন্য
ঘোষণাটি দেখুন।
ব্যতিক্রম পরিমাপ
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
আপনি একটি ওয়েব পৃষ্ঠায় ঘটে যাওয়া ক্র্যাশ বা ত্রুটির সংখ্যা এবং প্রকার পরিমাপ করতে ব্যতিক্রম ইভেন্ট পাঠাতে পারেন। এই পৃষ্ঠাটি Google Analytics-এ ব্যতিক্রমগুলি পাঠাতে কিভাবে gtag.js ব্যবহার করতে হয় তা বর্ণনা করে।
বাস্তবায়ন
একটি ত্রুটি ঘটলে, Google Analytics-এ একটি ব্যতিক্রম ইভেন্ট পাঠান:
gtag('event', 'exception', {<exception_parameters>});
যেখানে <exception_parameters>
হল এক বা একাধিক প্যারামিটার-মান জোড়া। একটি কমা দ্বারা প্রতিটি জোড়া পৃথক করুন. উদাহরণস্বরূপ, এই কমান্ডটি একটি অপ্রত্যাশিত ত্রুটি ব্যতিক্রম পাঠায়।
gtag('event', 'exception', {
'description': 'error_description',
'fatal': false // set to true if the error is fatal
});
ব্যতিক্রম পরামিতি
নিম্নলিখিত সারণী ব্যতিক্রম পরামিতি তালিকাভুক্ত করে:
পরামিতি নাম | ডেটা টাইপ | প্রয়োজন | বর্ণনা |
---|
description | স্ট্রিং | না | ত্রুটির একটি বর্ণনা। |
fatal | বুলিয়ান | না | true যদি ত্রুটি মারাত্মক হয়। |
উদাহরণ
নিম্নলিখিত ফাংশন দেওয়া:
function divide(x, y) {
if (y === 0) {
throw "Division by zero";
}
return x/y;
}
ভাজক y শূন্য হলে নিম্নলিখিত কোডটি Google Analytics-এ একটি ব্যতিক্রম ঘটনা পাঠাবে:
var x = document.getElementById('x').value;
var y = document.getElementById('y').value;
try {
var r = divide(x, y);
} catch(err) {
gtag('event', 'exception', {
'description': err,
'fatal': false
});
}
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-01-07 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-01-07 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eGoogle Analytics can track website errors and crashes using exception events sent via gtag.js.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egtag('event', 'exception', {<exception_parameters>})\u003c/code\u003e is the core function to send exception data, including an optional description and fatality status.\u003c/p\u003e\n"],["\u003cp\u003eAn example demonstrates how to capture and send exceptions occurring within a JavaScript \u003ccode\u003etry...catch\u003c/code\u003e block.\u003c/p\u003e\n"]]],["Exception events, used to track web page crashes and errors, are sent to Google Analytics via the `gtag('event', 'exception', {\u003cexception_parameters\u003e});` command. `\u003cexception_parameters\u003e` include 'description' (error details) and 'fatal' (boolean indicating if the error is fatal). When an error is detected, a `gtag` event can be sent. An example uses a `try...catch` block to intercept division-by-zero errors and trigger the `gtag` event.\n"],null,["# Measure exceptions\n\nYou can send exception events to measure the number and type of crashes or\nerrors that occur on a web page. This page describes how to use gtag.js to send\nexceptions to Google Analytics.\n\nImplementation\n--------------\n\nWhen an error occurs, send an exception event to Google Analytics: \n\n gtag('event', 'exception', {\u003cexception_parameters\u003e});\n\nwhere `\u003cexception_parameters\u003e` is one or more parameter-value pairs. Separate\neach pair by a comma. For example, this command sends a nonfatal error\nexception. \n\n gtag('event', 'exception', {\n 'description': 'error_description',\n 'fatal': false // set to true if the error is fatal\n });\n\nException parameters\n--------------------\n\nThe following table lists the exception parameters:\n\n| Parameter name | Data type | Required | Description |\n|----------------|-----------|----------|--------------------------------|\n| `description` | string | No | A description of the error. |\n| `fatal` | boolean | No | `true` if the error was fatal. |\n\nExample\n-------\n\nGiven the following function: \n\n function divide(x, y) {\n if (y === 0) {\n throw \"Division by zero\";\n }\n return x/y;\n }\n\nthe following code will send an exception event to Google Analytics if the\ndivisor y is zero: \n\n var x = document.getElementById('x').value;\n var y = document.getElementById('y').value;\n\n try {\n var r = divide(x, y);\n } catch(err) {\n gtag('event', 'exception', {\n 'description': err,\n 'fatal': false\n });\n }"]]