Echo/Docs

CLI command

landing rules

Dynamic landings: a block's content matched to the visit's own parameters, such as the campaign or search term it came from.

Invocation#

Shell
echo-cli landing rules --app <web source>
echo-cli landing rule --app <web source> --block <block-key> --parameter <name> --value <value> --content <text> --by <name>
echo-cli landing unrule --rule <rule-id>
echo-cli landing matches --rule <rule-id>

Inputs and output#

rules writes the web source's rules, oldest first: id, app_id, block_key, parameter, value (in lower case), content, created_by and created_at. rule and unrule write the rule. matches writes the visits the rule matched, newest first: rule_id, subject_id, parameter, value and matched_at.

State effect#

Every verb calls Echo Web's authenticated /api/analytics/landing/rules with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Dynamic landing rules section of the tracking screen and of Echo Desktop's GEO screen call the same operation, and echo-mcp reads rules and matches as echo_landing_rules. A landing passes its own address's parameters to /api/public/landing beside app_id, block_key and subject. When the block has a rule whose parameter the visit carries with its value (compared trimmed and case-blind), the oldest such rule answers { rule_id, test_id: null, variant: null, content }, and the match is stored in landing_rule_matches; with no rule matching, the block's running test answers as the landing page describes. At most one rule exists per block, parameter and value; removing a rule removes its matches.

Refusals#

  • A wrong invocation is refused before anything is sent: "landing takes <every verb's usage, separated by semicolons>; got <word>", "landing <verb> does not take <flag>; it takes …", "<flag> needs a value" and "landing <verb> needs <flag>".
  • Echo Web answers a bad request with "app_id is required: …", "block_key is required: …", "parameter is required: the visit parameter the rule reads, as the landing passes it on", "value is required: the value the parameter must hold", "content is required: what the landing shows when the rule matches" or "rule_id is required: …"; not found with "no landing rule has id <id>; echo-cli landing rules --app <source> shows them"; and a conflict with "block <block> of <source> already has rule <id> for <parameter>=<value>". The command prints Echo Web's sentence and exits 1.