John Turner

Husband, Father, Entrepreneur, Positive Vibes, About Me

๐Ÿ“ˆ 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 the 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 visit 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.

<?php
// 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 year"),"/","seedprod.com" );
}
}
}

So what I’m doing here is inserting a cookie on the user’s browser if not set with the source which is ”free_plugin’ and the datetime with a pipe as a delimiter. When and if the user purchases my Pro Version I then check and read that cookie if it exists and add the info to the user’s order record. How you do this will depend on what you are using to sell your plugin. I have a custom system but I will provide the code so you can see how I’m reading the cookie.

<?php
// Record Source
try {
$seedprod_source = $_COOKIE['seedprod_source'];
$source = '';
if(!empty($seedprod_source)){
$source = explode("|",$seedprod_source)[0];
$dt = date("Y-m-d H:i:s",explode("|",$seedprod_source)[1]);
$order = Order::find($data['order']->id);
$order->source = $source;
$order->source_datetime = $dt;
$order->save();
\Cookie::queue(\Cookie::forget('seedprod_source'));
}
$data['source'] = $source;
}catch(\Exception $e){
}

So now I have the source and datetime on the order record. Now I can just use SQL queries to figure out how long free to pay is and what percentage comes from .org.

Here’s what I learned:

Time to purchase:
within 1 minute: 2%
within 2 minutes: 14%
within 3 minutes: 25%
within 4 minutes: 35%
within 5 minutes: 40%
within 10 minutes: 53%
within 20 minutes: 61%
within 30 minutes: 65%
within 1 hour: 70%
within 2 hours: 74%
within 3 hours: 76%
within 12 hours: 80%
within 1 day: 83%
within 2 days: 87%
within 1 week: 92%
within 2 weeks 95%
within 1 month: 98%
greater than 1 month 2%

Percent of sales from .org:
48%

Hope this gives you some clearer insights into your sales funnel.

Copyright ยฉ 2024.  All rights reserved