Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ethanclevenger91/store-utm-params-to-cookie/archive/refs/heads/main.zipOn Packagist as ethanclevenger91/store-utm-params-to-cookie:
composer require ethanclevenger91/store-utm-params-to-cookieNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Saves all query params starting with 'utm' to a cookie.
Saves all query params starting with 'utm' to a cookie prefixed with sup set to store for 24 hours.
Let's say a user clicks an ad and lands at yoursite.org?utmterm=term&utmcampaign=ppc&foo=bar. Two cookies will be created:
1. suputmterm with the value term.
2. suputmcampaign with the value ppc.
Note that non-utm params are not saved.
Gravity Forms won't prepopulate fields with cookie values by default. See https://github.com/ethanclevenger91/gf-dynamic-population-from-cookies for a cache-friendly solution.
Initial release.