fix: use exact Windsor.ai field names for LinkedIn Pages organic metrics
This commit is contained in:
@@ -130,7 +130,7 @@ export async function GET() {
|
|||||||
{ signal: AbortSignal.timeout(8000) }
|
{ signal: AbortSignal.timeout(8000) }
|
||||||
).then((r) => r.json()).catch(() => null),
|
).then((r) => r.json()).catch(() => null),
|
||||||
fetch(
|
fetch(
|
||||||
`https://connectors.windsor.ai/linkedin_organic?api_key=${WINDSOR_API_KEY}&date_from=${startStr}&date_to=${endStr}&fields=date,impressions,clicks,engagement,followers`,
|
`https://connectors.windsor.ai/linkedin_organic?api_key=${WINDSOR_API_KEY}&date_from=${startStr}&date_to=${endStr}&fields=date,account_analytics_impression_count,account_analytics_click_count,account_analytics_total_engagements,followers_gain_organic`,
|
||||||
{ signal: AbortSignal.timeout(8000) }
|
{ signal: AbortSignal.timeout(8000) }
|
||||||
).then((r) => r.json()).catch(() => null),
|
).then((r) => r.json()).catch(() => null),
|
||||||
]);
|
]);
|
||||||
@@ -156,10 +156,10 @@ export async function GET() {
|
|||||||
if (!row.date || row.date < startStr || row.date > endStr) continue;
|
if (!row.date || row.date < startStr || row.date > endStr) continue;
|
||||||
const idx = getIdx(row.date);
|
const idx = getIdx(row.date);
|
||||||
if (idx >= 0 && idx < daysCount) {
|
if (idx >= 0 && idx < daysCount) {
|
||||||
if (row.impressions != null) K.src.li.m.imp[idx] = Number(row.impressions);
|
if (row.account_analytics_impression_count != null) K.src.li.m.imp[idx] = Number(row.account_analytics_impression_count);
|
||||||
if (row.clicks != null) K.src.li.m.clk[idx] = Number(row.clicks);
|
if (row.account_analytics_click_count != null) K.src.li.m.clk[idx] = Number(row.account_analytics_click_count);
|
||||||
if (row.engagement != null) K.src.li.m.eng[idx] = Number(row.engagement);
|
if (row.account_analytics_total_engagements != null) K.src.li.m.eng[idx] = Number(row.account_analytics_total_engagements);
|
||||||
if (row.followers != null) K.src.li.m.fol[idx] = Number(row.followers);
|
if (row.followers_gain_organic != null) K.src.li.m.fol[idx] = Number(row.followers_gain_organic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user