Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/setup-node@v6
- uses: actions/setup-node@v7
with:
node-version: "22.x"
node-version: "24.x"
cache: "npm"

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

- uses: actions/setup-node@v6
- uses: actions/setup-node@v7
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Marketers use UTM parameters to track the effectiveness of online campaigns across traffic sources and publishing media.
The parameters identify the campaign that drives traffic to a specific website and can be parsed by analytics tools and used to populate reports.

Copying these parameters and injecting them into your form submissions manually is tedious and error-prone, we built Formtrack to automate this process.
Copying these parameters and injecting them into your form submissions manually is tedious and error-prone, so we built Formtrack to automate this process.

## Installation & usage

Expand All @@ -38,13 +38,23 @@ Add a `data-formtrack` attribute to your form element.

Formtrack will now automatically inject the supported parameters into your HTML form submissions.

Alternatively, install the package with npm.

```bash
npm install @formspark/formtrack
```

```js
import "@formspark/formtrack";
```

## Supported parameters

| Parameter | Purpose | Example |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| ref | Identifies which site sent the traffic, not an official parameter. | ref=producthunt |
| referrer | Identifies which site sent the traffic, not an official parameter. | referrer=producthunt |
| utm_source | Identifies which site sent the traffic, and is a required parameter. | utm_source=google |
| ref | Identifies which site sent the traffic. Not an official UTM parameter. | ref=producthunt |
| referrer | Identifies which site sent the traffic. Not an official UTM parameter. | referrer=producthunt |
| utm_source | Identifies which site sent the traffic. This is a required parameter. | utm_source=google |
| utm_medium | Identifies what type of link was used, such as cost per click or email. | utm_medium=cpc |
| utm_campaign | Identifies a specific product promotion or strategic campaign. | utm_campaign=spring_sale |
| utm_term | Identifies search terms. | utm_term=running+shoes |
Expand All @@ -54,7 +64,7 @@ Formtrack will now automatically inject the supported parameters into your HTML

You have the flexibility to define a list of custom parameters.

Include a `data-formtrack-params` attribute within your form element, and populate it with a comma-separated list of the desired parameters.
Include a `data-formtrack-params` attribute on your form element and populate it with a comma-separated list of the desired parameters.

```html
<form
Expand Down
Loading