@easyfunnel/mcp 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +40 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -832,8 +832,8 @@ var queryEventsDefinition = {
|
|
|
832
832
|
project_id: { type: "string", description: "Project ID" },
|
|
833
833
|
query_type: {
|
|
834
834
|
type: "string",
|
|
835
|
-
enum: ["count", "recent", "breakdown", "section_engagement", "traffic_sources"],
|
|
836
|
-
description:
|
|
835
|
+
enum: ["count", "recent", "breakdown", "section_engagement", "traffic_sources", "engagement"],
|
|
836
|
+
description: 'Type of query. Use "engagement" to get scroll depth and engaged time metrics.'
|
|
837
837
|
},
|
|
838
838
|
event_name: {
|
|
839
839
|
type: "string",
|
|
@@ -871,7 +871,9 @@ async function queryEvents(client2, args) {
|
|
|
871
871
|
`;
|
|
872
872
|
output += ` Unique sessions: ${data.unique_sessions}
|
|
873
873
|
`;
|
|
874
|
-
output += ` Unique
|
|
874
|
+
output += ` Unique visitors: ${data.unique_visitors}
|
|
875
|
+
`;
|
|
876
|
+
output += ` Identified users: ${data.identified_users}
|
|
875
877
|
`;
|
|
876
878
|
} else if (args.query_type === "recent") {
|
|
877
879
|
output = `Recent events:
|
|
@@ -881,8 +883,43 @@ async function queryEvents(client2, args) {
|
|
|
881
883
|
output += ` [${event.created_at}] ${event.event_name}`;
|
|
882
884
|
if (event.properties?.url) output += ` \u2014 ${event.properties.url}`;
|
|
883
885
|
output += "\n";
|
|
886
|
+
if (event.properties) {
|
|
887
|
+
const props = { ...event.properties };
|
|
888
|
+
delete props.url;
|
|
889
|
+
const keys = Object.keys(props);
|
|
890
|
+
if (keys.length > 0) {
|
|
891
|
+
output += ` properties: ${JSON.stringify(props)}
|
|
892
|
+
`;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
884
895
|
}
|
|
885
896
|
if (!data.events?.length) output += " No events found.\n";
|
|
897
|
+
} else if (args.query_type === "engagement") {
|
|
898
|
+
output = `Engagement metrics (${args.time_range || "7d"}):
|
|
899
|
+
|
|
900
|
+
`;
|
|
901
|
+
output += ` Avg scroll depth: ${data.avg_scroll_depth}%
|
|
902
|
+
`;
|
|
903
|
+
output += ` Avg engaged time: ${data.avg_engaged_time}s
|
|
904
|
+
`;
|
|
905
|
+
output += ` Total engagement events: ${data.total_events}
|
|
906
|
+
|
|
907
|
+
`;
|
|
908
|
+
output += ` Scroll depth distribution:
|
|
909
|
+
`;
|
|
910
|
+
for (const bucket of data.scroll_depth_distribution || []) {
|
|
911
|
+
output += ` ${bucket.bucket}: ${bucket.count} events
|
|
912
|
+
`;
|
|
913
|
+
}
|
|
914
|
+
if (data.top_pages?.length) {
|
|
915
|
+
output += `
|
|
916
|
+
Top pages by scroll depth:
|
|
917
|
+
`;
|
|
918
|
+
for (const page of data.top_pages) {
|
|
919
|
+
output += ` ${page.url}: ${page.avg_scroll_depth}% avg, ${page.count} events
|
|
920
|
+
`;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
886
923
|
} else if (args.query_type === "section_engagement") {
|
|
887
924
|
output = `Section engagement (${args.time_range || "7d"}):
|
|
888
925
|
|