{"id":643,"date":"2013-08-16T14:24:47","date_gmt":"2013-08-16T18:24:47","guid":{"rendered":"http:\/\/insights.canopylabs.com\/?p=611"},"modified":"2018-06-05T15:34:41","modified_gmt":"2018-06-05T19:34:41","slug":"how-to-measure-email-campaign-purchase-conversion-r-console-tutorial","status":"publish","type":"post","link":"https:\/\/staging.oddbee.com\/canopy-labs\/how-to-measure-email-campaign-purchase-conversion-r-console-tutorial\/","title":{"rendered":"How to measure email campaign purchase conversion \u2013 R Console tutorial"},"content":{"rendered":"<p>Every email marketer wants to be able to directly track sales generated by a specific campaign. Commonly used metrics such as open rates and click rates are only rough proxies for the measures that really matter &#8211; purchase conversion and total sales. In this blog post, we will explore how to use the Canopy Labs R Console to assess and compare email campaign performance.<\/p>\n<p><span style=\"text-decoration: underline;\"><b>Setting up the test<\/b><\/span><\/p>\n<p>The precondition to assess campaigns based on revenue is to combine purchase data with email engagement data. These are two of the most popular forms of data that our customers upload into the Canopy Labs platform through our <a title=\"Import\" href=\"https:\/\/beta.canopylabs.com\/import.php\" target=\"_blank\" rel=\"noopener\">Import<\/a> interface.<\/p>\n<p>To begin, choose which emails to test. Some stores use the tool to compare performance of recent email newsletters. Others want to determine the result of an A\/B segmentation campaign so they can learn how to market more effectively. Once you have chosen the emails to test, find their corresponding campaign IDs, either through individual customer profiles on the Canopy Platform (see below) or on your email marketing platform.<\/p>\n<p><a href=\"http:\/\/staging.oddbee.com\/canopy-labs\/wp-content\/uploads\/2014\/06\/EmailID.png\" rel=\"attachment wp-att-618\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-618\" src=\"http:\/\/staging.oddbee.com\/canopy-labs\/wp-content\/uploads\/2014\/06\/EmailID.png\" alt=\"Example from a customer profile\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The next step is to set the time lag variables that will determine whether or not a sale should be attributed to an email campaign. For example, we typically attribute a sale to a campaign if a customer opens or clicks within 5 days of receiving the email, and then makes a purchase within 2 days of that open or click.<\/p>\n<p>Below is the portion of code that can be modified and entered into the <a title=\"R Console\" href=\"https:\/\/beta.canopylabs.com\/r-proto.php\" target=\"_blank\" rel=\"noopener\">R Console<\/a> to set the email IDs and choices of time lag variables:<\/p>\n<pre style=\"font-family: Courier, 'Courier New', monospace; font-size: 75%; background: #ebebeb; padding: 2px;\"># Load customer collection\r\ncustomers &lt;- canopy.import(\"customers\")\r\n\r\n# Enter email IDs to analyze in the list, each with \"quotes\"\r\n# You can choose as many email IDs as you like\r\nemailID&lt;-c(\"22222222\",\"33222233\")\r\n\r\n# Set the time lag from receiving an email to opening or clicking\r\ncampaignlag = 5;\r\n\r\n# Set the time lag from clicking an email to making a purchase\r\nclicklag = 2;\r\n\r\n# Set the time lag from opening an email to making a purchase\r\nopenlag = 2;<\/pre>\n<p>The below link contains the full set of R code that can be used actually run the analysis of email campaign performance and print the results. Simply copy this code, paste into the\u00a0<a title=\"R Console\" href=\"https:\/\/beta.canopylabs.com\/r-proto.php\" target=\"_blank\" rel=\"noopener\">R Console<\/a>, change the variables at the begging of the script to your desired values, and hit &#8220;Submit&#8221;. The script will run and print the results when finished.<\/p>\n<p><a href=\"http:\/\/staging.oddbee.com\/canopy-labs\/wp-content\/uploads\/2014\/06\/campaign-performance.txt\">Email campaign success tracking<\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><b>Analyzing Results<\/b><\/span><\/p>\n<p>The code prints a set of results in the output screen on the R Console that indicate campaign performance. For each campaign, the following data is displayed:<\/p>\n<ol>\n<li><b style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;\">Customers: <\/b>the script prints the IDs of the customers that made purchases from this campaign. Try entering one of these customer IDs into the <a title=\"Customer Profiles\" href=\"https:\/\/beta.canopylabs.com\/profiles.php\" target=\"_blank\" rel=\"noopener\">Browse Customers<\/a> interface to see their full action history.<\/li>\n<li><b style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;\">Engagement counts: <\/b>the next 4 numbers show the number of customers who received the email, opened, clicked, and made a purchase.<\/li>\n<li><b style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;\">Conversion rates: <\/b>the next 3 numbers show the open rate, click rate, and purchase rate generated by the campaign (interpret these as percentages).<\/li>\n<li><b style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;\">Sales generated: <\/b>finally, the last number shows the total dollar value of all sales generated by the campaign.<\/li>\n<\/ol>\n<p><span style=\"text-decoration: underline;\"><b>Conclusion<\/b><\/span><\/p>\n<p>As you can see, running email campaign performance analytics through the Canopy Labs R console is quick and flexible. Give it a try to today, and start learning more about which campaigns are working and how you should optimize email marketing going forward! If you need any help, let us know in the comments below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every email marketer wants to be able to directly track sales generated by a specific campaign. Commonly used metrics such as open rates and click rates are only rough proxies for the measures that really matter &#8211; purchase conversion and total sales. In this blog post, we will explore how to use the Canopy Labs [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"_links":{"self":[{"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/posts\/643"}],"collection":[{"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":1,"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/posts\/643\/revisions"}],"predecessor-version":[{"id":5848,"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/posts\/643\/revisions\/5848"}],"wp:attachment":[{"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.oddbee.com\/canopy-labs\/wp-json\/wp\/v2\/categories?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}