@gorillabot-labs/sticky-query-params
v1.1.0
Published
A tiny javascript module that saves marketing query params across page loads to better track conversions
Downloads
11
Readme
Sticky Query Params
A tiny javascript module that saves marketing query params across page loads to better track conversions
Usage
Usage
<script src="https://cdn.jsdelivr.net/npm/@gorillabot-labs/sticky-query-params@latest/dist/index.js"></script>
<script>
var sqpConfig = {};
sqpConfig.conversionDomain = "app.awesomeproduct.com";
window.addEventListener('load', (event) => {
try {
sqp.stickParams(sqpConfig);
} catch (e) {
console.log(e);
}
});
</script>
Note: Some build tools make explicit use of Node features which have been introduced in version 8.9.0. Please make sure you're using the correct Node version (>8.9.0) before you proceed to create your own build using the commands listed below.
Development
Keep this module light-weight. Consumers will be uploading this onto their marketing websites and we don't want to slow them down.
3 Rules to keep in mind:
- Keep it simple
- Keep it fast
- Keep it tested
Examples
- Check examples directory or run
yarn examples
Testing
- Run test suite:
yarn test
Deployment
- Run test suite:
yarn test
- Create build:
yarn build
- Bump package.json version
- Commit new version
git add . && git commit
- Publish to npm
npm publish --access public