{{define "content"}}{{with .Data}}{{$d := .}}

Lead forms

Your website's forms ("send me a cost comparison", "become a partner") send each answer to EspoCRM as a new Lead, using EspoCRM's own Lead Capture: Supermarket only runs on this computer, so the forms can't post to it. The Lead's description says which form, which page, and which campaign brought the visitor; Plausible counts the forms sent per buying signal.

{{if not .Sites}}

Add your website and its Hugo repository under Settings → Profile first.

{{else}} {{if gt (len .Sites) 1}}{{end}} {{with .Current}}{{$cur := .}} {{if .Err}}

{{.URL}}: {{.Err}}.

{{else}} {{if not $d.HasSynced}}

Read {{.Repo}} under Sections and pages first.

{{else}}{{with $d.State}}

Now

{{if $d.Connected}}

Connected: the forms on {{$cur.URL}} send their answers to EspoCRM.

{{else if .Action}}

The forms post to {{.Action}}{{if not .Patched}}, without Supermarket's mapping{{end}}.

{{else}}

The forms open an email with the answers filled in: they don't post anywhere yet.

{{end}} {{with .Pages}}

Pages with a form: {{join . ", "}}

{{else}}

No page has a form section yet. The page builder can add one where the site has the form section type.

{{end}} {{if not .Supported}}

This site's form section doesn't post the way Supermarket knows, so it can't be connected automatically.

{{end}}
{{end}}{{end}}

1. In EspoCRM

  1. Open {{with $d.CRM}}EspoCRM{{else}}EspoCRM{{end}} as an administrator: Administration → Lead Capture → Create Lead Capture.
  2. Name it after the site, tick Is Active, and under Payload Fields add: {{join $d.Payload ", "}}.
  3. Optional: a Campaign (for EspoCRM's own campaign statistics), a Target List, a Target Team, and Double Opt-in if people should confirm by email.
  4. Save, and copy the API URL it shows: https://…/api/v1/LeadCapture/….

Your site must be allowed to post to the CRM: EspoCRM allows every site by default (leadCaptureAllowOrigin in its data/config.php). The test below checks it.

2. The Lead Capture's address

The test asks the CRM whether {{.URL}} may post to it, the way a browser would. Nothing is created.

3. Connect the forms

Opens a pull request on {{.Repo}} that sets the forms' address, adds a small script mapping their fields onto a Lead's (name, email, organization, phone; the rest, the page and the campaign go in the description), and has the form section post through it. Merging publishes it.

{{with $d.PR}}

{{if eq .State "merged"}}Merged. Send a test form on the live site and look for the Lead in EspoCRM.{{else if eq .State "closed"}}The last pull request was closed without merging.{{else}}A pull request is open{{end}} {{.URL}} ↗ {{ago .At}}

{{end}}
{{end}} {{end}} {{end}}

Forms sent, by buying signal

{{if not .Plausible}}

Counted from Plausible: save its key under Settings → Website & sales.

{{end}}

The forms tell Plausible when they're sent (a {{.Goal}} event). Add a {{.Goal}} goal (a custom event) in Plausible, and the daily import counts the ones from visits tagged with a signal as interested on its scorecard.

{{with .Leads}}
{{range .}}{{end}}
DaySignalFormsFrom
{{.At.Format "2 Jan 2006"}}{{.Signal}}{{.Count}}{{.Note}}
{{else}}

None counted yet.

{{end}} {{end}}{{end}}