Skip to content

chore: update track lead documentation#2

Open
louisfacun wants to merge 3 commits intomainfrom
chore/update-track-lead-function
Open

chore: update track lead documentation#2
louisfacun wants to merge 3 commits intomainfrom
chore/update-track-lead-function

Conversation

@louisfacun
Copy link
Copy Markdown
Member

@louisfacun louisfacun commented Feb 6, 2026

Summary by CodeRabbit

  • Documentation
    • Updated trackLead docs to show an optional second parameter, formTitle (string, max 255 chars).
    • Examples updated to demonstrate passing the form title alongside lead data.
    • “When to use” guidance reworded to highlight custom-form scenarios and using formTitle for richer lead context.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 6, 2026

Walkthrough

README.md updated: trackLead signature changed from trackLead(data) to trackLead(data, formTitle). Documentation adds a formTitle parameter description (string, max 255 chars), updates example usage to pass the form title, and adjusts "When to use" wording. beep boop

Changes

Cohort / File(s) Summary
Documentation
README.md
Changed public API docs: trackLead(data)trackLead(data, formTitle). Added formTitle parameter details (string, max 255 chars), updated example usage and "When to use" text.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

bzzz

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating documentation for the trackLead function to reflect the new formTitle parameter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-track-lead-function

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@README.md`:
- Line 5: Update the opening description sentence that starts "Submit a lead
record with custom data..." to briefly mention the new form identification
parameters by name; explicitly note that the SDK also accepts formTitle and
formType to identify the submitting form (in addition to lead source and visitor
journey data) so readers see these parameters up front before the Parameters
section.
- Around line 11-16: Update the README entry for the form schema to document
validation and error handling for the formType and formTitle fields: state that
formType must be one of "elementor-forms", "gravity-forms", "ninja-forms", or
"custom-forms" and describe the behavior when an invalid value is provided
(e.g., request rejected with a validation error/HTTP 400 or a thrown
ValidationError with a clear message referencing formType), and state that
formTitle is limited to 255 characters and that exceeding this limit results in
a validation error/HTTP 400 (include the exact error messages or error object
shape your API/library returns so consumers know how to detect these cases).
- Around line 9-16: Update the README entry for the trackLead API to state
explicitly whether the parameters are required or optional: annotate `formTitle`
and `formType` (and `data` if needed) as "required" or "optional", and if
optional, document the default behavior when omitted (e.g., default formType
value or treatment in trackLead). Reference the `trackLead` function and the
parameter names `data`, `formTitle`, and `formType` so callers know if this is a
breaking change and how the SDK behaves when those args are not provided.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 9-10: Update the parameters section to document the missing third
parameter `formType` (e.g., string like "elementor-forms"), and mark each
parameter as required or optional; specifically, add a line describing
`formType` (type, allowed values if any, and purpose) alongside the existing
`data` and `formTitle` entries and annotate all three with "(required)" or
"(optional)" to match the example call that passes three arguments.
- Line 3: Update the trackLead documentation and signature to include the third
parameter formType so it matches the example usage; modify the signature line
showing `trackLead(data, formTitle)` to `trackLead(data, formTitle, formType)`
and add/update the Parameters section to document the new `formType` parameter
(describe expected values like "elementor-forms" or other form source
identifiers), ensuring the example invocation and parameter docs are consistent
with the function name `trackLead`.

@louisfacun louisfacun requested a review from f-tepel February 12, 2026 10:12
@louisfacun louisfacun force-pushed the chore/update-track-lead-function branch from 4a9d049 to cd4bc6a Compare February 12, 2026 12:52
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@README.md`:
- Line 5: Update the description for "Submit a lead record" to explicitly
mention the new formTitle parameter: state that in addition to custom data and
visitor/lead source data the SDK accepts a formTitle (a human-readable
identifier for the form) to help identify the submission; reference the
submit-a-lead-record functionality and the formTitle parameter so users see
at-a-glance that form identification is supported.

## `trackLead(data)`
## `trackLead(data, formTitle)`

Submit a lead record with custom data. The SDK will automatically include all lead source data and visitor journey data when sending the lead record. Used to send data to your LeadSources dashboard.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider mentioning the formTitle parameter in the description. bzzz

The past review comment suggesting to update the description to mention the new formTitle parameter is still valid. The description currently focuses only on "custom data" but doesn't indicate that the function now also accepts form identification information. beep

While users can find this in the Parameters section, the description would be more complete if it briefly mentioned that the function accepts a form title for identification purposes.

🤖 Prompt for AI Agents
In `@README.md` at line 5, Update the description for "Submit a lead record" to
explicitly mention the new formTitle parameter: state that in addition to custom
data and visitor/lead source data the SDK accepts a formTitle (a human-readable
identifier for the form) to help identify the submission; reference the
submit-a-lead-record functionality and the formTitle parameter so users see
at-a-glance that form identification is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant