Skip to content

Commit b2bd567

Browse files
waleedlatif1claude
andcommitted
fix(meta-ads): include onsite_conversion and app_custom_event subtypes in conversions
The conversion filter was only matching offsite_conversion.* subtypes but missing onsite_conversion.* and app_custom_event.* subtypes, which the Meta API commonly returns at the subtype level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 478bcc0 commit b2bd567

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/sim/tools/meta_ads/get_insights.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,14 @@ export const metaAdsGetInsightsTool: ToolConfig<
132132
'onsite_conversion',
133133
'app_custom_event',
134134
])
135+
const conversionPrefixes = ['offsite_conversion.', 'onsite_conversion.', 'app_custom_event.']
135136
const conversions = actions
136137
.filter((a) => {
137138
const actionType = a.action_type as string
138-
return conversionTypes.has(actionType) || actionType?.startsWith('offsite_conversion.')
139+
return (
140+
conversionTypes.has(actionType) ||
141+
conversionPrefixes.some((prefix) => actionType?.startsWith(prefix))
142+
)
139143
})
140144
.reduce((sum, a) => sum + Number(a.value ?? 0), 0)
141145

0 commit comments

Comments
 (0)