0.1.36 • Published 6 months ago

@formspark/formtrack v0.1.36

Weekly downloads
59
License
MIT
Repository
github
Last release
6 months ago

Continuous deployment

About

Marketers use UTM parameters to track the effectiveness of online campaigns across traffic sources and publishing media. The parameters identify the campaign that refers 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.

Installation & usage

Add the Formtrack script.

<script src="https://unpkg.com/@formspark/formtrack" async></script>

Add a data-formtrack attribute to your form element.

<form action="https://submit-form.com" data-formtrack>
  <input type="text" name="message" />
  <button type="submit">Send</button>
</form>

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

Supported parameters

ParameterPurposeExample
refIdentifies which site sent the traffic, not an official parameter.ref=producthunt
referrerIdentifies which site sent the traffic, not an official parameter.referrer=producthunt
utm_sourceIdentifies which site sent the traffic, and is a required parameter.utm_source=google
utm_mediumIdentifies what type of link was used, such as cost per click or email.utm_medium=cpc
utm_campaignIdentifies a specific product promotion or strategic campaign.utm_campaign=spring_sale
utm_termIdentifies search terms.utm_term=running+shoes
utm_contentIdentifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link. It is often used for A/B testing and content-targeted ads.utm_content=logolink or utm_content=textlink

Custom parameters

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.

<form
  action="https://submit-form.com"
  data-formtrack
  data-formtrack-params="custom_param_1,custom_param_2"
>
  ...
</form>

License

MIT

0.1.36

6 months ago

0.1.33

2 years ago

0.1.34

2 years ago

0.1.35

2 years ago

0.1.32

2 years ago

0.1.30

2 years ago

0.1.31

2 years ago

0.1.29

2 years ago

0.1.28

3 years ago

0.1.27

3 years ago

0.1.26

3 years ago

0.1.25

3 years ago

0.1.24

3 years ago

0.1.23

3 years ago

0.1.22

3 years ago

0.1.21

3 years ago

0.1.20

3 years ago

0.1.19

3 years ago

0.1.17

3 years ago

0.1.18

3 years ago

0.1.16

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago