CLI command
social advocacy
Sharing through the team's own accounts once the offered text is approved: each member's tracked link, the shares they record and the visitors their link brought.
Invocation#
echo-cli social advocacy campaigns
echo-cli social advocacy start --name <n> --app <web source> --landing <https url> --source <v> --medium <v> --campaign <v> --text <share text> --by <who>
echo-cli social advocacy approve --campaign <campaign-id> --by <who>
echo-cli social advocacy join --campaign <campaign-id> --member <who>
echo-cli social advocacy leave --member <membership-id>
echo-cli social advocacy share --member <membership-id> --platform <p> --post <https url>
echo-cli social advocacy results --campaign <campaign-id> --days <n>Inputs and output#
campaigns, start and approve write campaigns: id, name, app_id, landing, utm_source, utm_medium, utm_campaign, share_text, created_by, created_at, approved_by and approved_at (null until approved). join and leave write the membership: id, campaign_id, member, url (their tracked link), opted_in_at and opted_out_at. share writes the share: id, member_id, platform, post_url and shared_at. results writes { since, members }: each membership with its shares and visitors — the distinct people the web source's stored events show arriving through the member's link in the window.
State effect#
The verbs call Echo Web's authenticated /api/analytics/advocacy with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Employee advocacy section of the ecosystem's analytics and of Echo Desktop's GEO screen do the same, and echo-mcp runs them as echo_advocacy_campaigns, _start, _approve, _join, _leave, _share and _results. A campaign's --source, --medium and --campaign must be declared in the web source's UTM vocabulary (echo-cli tracking utm add). The text a campaign offers is approved once, by someone other than who started it; until then nobody joins it and no share is recorded. Joining declares the membership's id as a utm_content value of the source and builds the member's link from the landing page with the campaign's values and that utm_content, so the attribution collector attributes each visit through it to the member; joining again after leaving reopens the same link. Campaigns, memberships and shares are kept in advocacy_campaigns, advocacy_members and advocacy_shares; campaigns started before approval was required are recorded as approved by their creator.
Refusals#
- A wrong invocation is refused before anything is sent: "social advocacy takes campaigns; start …; approve …; join …; leave …; share …; results …; got <word>", "social advocacy <verb> does not take <flag>; it takes …", "<flag> needs a value" and "social advocacy <verb> needs <flag>".
- Echo Web answers a bad request with "<field> is required: <what it is>", "landing must be an absolute https address: the page its links land on; got <value>" (and post_url), "<app> does not declare <parameter>=<value>; add it with echo-cli tracking utm add first", "<campaign> offers text nobody has approved yet; echo-cli social advocacy approve --campaign <id> --by <who> approves it", "<who> started <campaign>, so someone else approves the text it offers", "<member> opted out at <time>; a share is recorded only while they are opted in" or "days must be a positive whole number: the window to read"; not found with "no advocacy campaign has id <id>", "no advocacy membership has id <id>" or "no opted-in membership has id <id>"; a conflict with "<member> already shares <campaign> through <url>", "<campaign> was approved by <who> at <time>" or "the campaign <name> could not be started: <cause>". The command prints Echo Web's sentence and exits 1.