---
agent_capabilities:
- Structured Data Analyzer
availability: IDEA
description: Analyzes leads generated from a campaign to find which industries and
regions have the highest average engagement scores, helping marketers double down
on what's working.
name: Campaign Engagement Hotspots
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EWhich+industries+and+regions+are+showing+the+highest+engagement+with+our+latest+campaign%3F+I+want+to+double-down+on+what%27s+working.%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESearching+for+recent+campaigns+in+your+%3Cb%3EMarketing+Platform%3C%2Fb%3E...%3C%2Fp%3E%22%2C%22status%22%3A%22pending%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EI+can+help+with+that.+To+analyze+engagement+hotspots%2C+please+select+a+campaign%3A%3C%2Fp%3E%22%7D%2C%7B%22richText%22%3A%22%3Col+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cp%3EQ3+Product+Launch%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3ESummer+Sale+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3EAnnual+User+Conference%3C%2Fp%3E%3C%2Fli%3E%3C%2Fol%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EQ3+Product+Launch%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EGreat.+I+will+analyze+the+%3Cb%3EQ3+Product+Launch%3C%2Fb%3E+campaign.+Here%E2%80%99s+the+plan+I%27ve+generated+to+identify+the+engagement+hotspots%3A%3C%2Fp%3E%22%7D%2C%7B%22apiBlock%22%3A%7B%22code%22%3A%22import+salesforce%5Cn%5Cn%23+Fetch+all+leads+from+the+specified+campaign%5Cncampaign_id+%3D+%277015g00000123AbcDEF%27%5Cnleads+%3D+salesforce.query%28%5Cn++++%5C%22SELECT+Id%2C+Industry%2C+Geolocation__c+FROM+Lead+WHERE+CampaignId+%3D+%27%5C%22+%2B+campaign_id+%2B+%5C%22%27%5C%22%5Cn%29%5Cn%5Cnprint%28f%5C%22Found+%7Blen%28leads%29%7D+leads+in+Salesforce.%5C%22%29%22%2C%22caption%22%3A%22This+script+will+fetch+leads+and+their+associated+industry+and+region+from+Salesforce+for+the+%27Q3+Product+Launch%27+campaign.%22%2C%22connectorName%22%3A%22python%22%2C%22title%22%3A%22Step+1%3A+Fetch+Leads+from+Salesforce%22%7D%7D%2C%7B%22apiBlock%22%3A%7B%22code%22%3A%22import+marketing_platform%5Cn%5Cn%23+Get+engagement+scores+from+the+marketing+platform+using+lead+IDs+from+the+previous+step%5Cnlead_ids+%3D+%5Blead%5B%27Id%27%5D+for+lead+in+previous_step.leads%5D%5Cnengagement_data+%3D+marketing_platform.get_engagement%28lead_ids%3Dlead_ids%29%5Cn%5Cnprint%28f%5C%22Retrieved+engagement+scores+for+%7Blen%28engagement_data%29%7D+leads.%5C%22%29%22%2C%22caption%22%3A%22Using+the+leads+from+Step+1%2C+this+script+retrieves+the+corresponding+engagement+scores+from+your+Marketing+Platform.%22%2C%22connectorName%22%3A%22python%22%2C%22title%22%3A%22Step+2%3A+Get+Engagement+Scores%22%7D%7D%2C%7B%22apiBlock%22%3A%7B%22code%22%3A%22import+pandas+as+pd%5Cn%5Cn%23+Create+DataFrames+from+the+data+gathered+in+the+previous+steps%5Cnleads_df+%3D+pd.DataFrame%28step_1.leads%29%5Cnengagement_df+%3D+pd.DataFrame%28step_2.engagement_data%29%5Cn%5Cn%23+Merge+the+two+datasets+on+the+Lead+ID%5Cnmerged_df+%3D+pd.merge%28leads_df%2C+engagement_df%2C+on%3D%27Id%27%29%5Cn%5Cn%23+Group+by+industry+and+region+to+find+the+average+engagement+score%5Cnresults+%3D+merged_df.groupby%28%5B%27Industry%27%2C+%27Geolocation__c%27%5D%29%5B%27engagement_score%27%5D.mean%28%29.reset_index%28%29%5Cn%5Cn%23+Sort+to+find+the+top+5+segments%5Cntop_segments+%3D+results.sort_values%28by%3D%27engagement_score%27%2C+ascending%3DFalse%29.head%285%29%5Cn%5Cnprint%28top_segments%29%22%2C%22caption%22%3A%22This+final+script+combines+the+lead+and+engagement+data%2C+groups+it+by+industry+and+region%2C+and+calculates+the+average+engagement+score+to+identify+the+top-performing+segments.%22%2C%22connectorName%22%3A%22python%22%2C%22title%22%3A%22Step+3%3A+Analyze+and+Group+Data%22%7D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EDoes+this+look+right%3F+Shall+I+proceed+with+the+analysis%3F%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EYes%2C+proceed%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESuccessfully+fetched+15%2C482+leads+from+%3Cb%3ESalesforce%3C%2Fb%3E.%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESuccessfully+retrieved+engagement+data+from+%3Cb%3EMarketing+Platform%3C%2Fb%3E.%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EExecuting+final+analysis+script...%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EAnalysis+complete.+Here+are+the+top+5+engagement+hotspots+for+the+%3Cb%3EQ3+Product+Launch%3C%2Fb%3E+campaign%3A%3C%2Fp%3E%3Col+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Technology%2C+%3Cb%3ERegion%3A%3C%2Fb%3E+North+America+%28Avg.+Engagement%3A+87.5%29%3C%2Fli%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Healthcare%2C+%3Cb%3ERegion%3A%3C%2Fb%3E+EMEA+%28Avg.+Engagement%3A+81.2%29%3C%2Fli%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Finance%2C+%3Cb%3ERegion%3A%3C%2Fb%3E+North+America+%28Avg.+Engagement%3A+79.8%29%3C%2Fli%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Technology%2C+%3Cb%3ERegion%3A%3C%2Fb%3E+APAC+%28Avg.+Engagement%3A+75.4%29%3C%2Fli%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Retail%2C+%3Cb%3ERegion%3A%3C%2Fb%3E+North+America+%28Avg.+Engagement%3A+72.1%29%3C%2Fli%3E%3C%2Fol%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EIt+looks+like+the+%3Cb%3ETechnology%3C%2Fb%3E+industry+in+%3Cb%3ENorth+America%3C%2Fb%3E+is+your+most+engaged+segment.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Q3+Product+Launch+Campaign+Data%22%2C%22connectorName%22%3A%22salesforce%22%7D%2C%7B%22citationTitle%22%3A%22Campaign+Engagement+Scores%22%2C%22connectorName%22%3A%22marketing-platform%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ELet+me+know+if+you+would+like+to+export+this+as+a+CSV+or+create+a+new+campaign+for+the+top+segment.%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D
solution_tags:
- Marketing
systems:
- salesforce
---