I am trying to fetch percentage of gender in my channel but it's showing me 92% male and 8% female but when i check it through the youtube studio it's show me 85% male and 15% female why this code is giving me wrong data or am I doing it wrong?:
here is the code
try { const startDate = "2005-02-14"; // Fallback to YouTube's start date const endDate = new Date().toISOString().split("T")[0]; // Current date in YYYY-MM-DD format const analytics = google.youtubeAnalytics({ version: "v2", auth: oauth2Client, }); const analyticsResponse = await analytics.reports.query({ ids: `channel==${channelId}`, startDate, endDate, dimensions: "gender,subscribedStatus", metrics: "viewerPercentage", // filters: "audienceType==ORGANIC", }); demographicData.gender = analyticsResponse.data.rows.map((row) => ({ gender: row[0], viewerPercentage: row[1], })); console.log("analyticsResponse: ", analyticsResponse.data); console.log("demographicData: ", demographicData.gender);} catch (error) { console.error("Error fetching gender data:", error);}