How to Track Free to Paid Plugins on wp.org
At the beginning of this year I started tracking users who visited my upsell page from my free coming soon plugin in wordpress.org to learn how many of my sales were coming from wordpress.org and to learn how long the conversion time was. I had been tracking this with campaign variables in Google Analytics but I felt it was not giving me an entirely accurate picture. Also Google Analytics only breaks down time to purchase by day. GA was saying 96% of my sales happened within one day. So adding my own tracking cookie would let me figure out exactly what was going on. Here’s how I implemented it. First I add a cookie to the user as soon as they visited my upsell page from my free plugins on wordpress.org. Since I don’t index my upsell page and the only way to get to it is via my upsell ad in my free plugin I knew this would only be users coming from the free version. I add this code in my functions.php on my theme.
// Set cookie of free user
add_action( ‘wp’, ‘track_upsell’ );
function track_upsell() {
if(is_page(‘ultimate-coming-soon-page-vs-coming-soon-pro’)){
if(!isset($_COOKIE[‘seedprod_source’])) {
setcookie( ‘seedprod_source’, ‘free_plugin|’.time(), strtotime("+1
Source: https://managewp.org/articles/16109/how-to-track-free-to-paid-plugins-on-wp-org
source https://williechiu40.wordpress.com/2017/09/17/how-to-track-free-to-paid-plugins-on-wp-org/