From 74cefdb572ecfc4aecc1ca4a5b54d850818c7233 Mon Sep 17 00:00:00 2001 From: rchinn-segment Date: Wed, 25 Oct 2023 16:32:20 -0700 Subject: [PATCH] More vale edits --- .../how-to-guides/cross-channel-tracking.md | 65 ++++++++++--------- .../how-to-guides/dynamic-coupon-program.md | 52 +++++++-------- src/guides/how-to-guides/forecast-with-sql.md | 34 +++++----- 3 files changed, 75 insertions(+), 76 deletions(-) diff --git a/src/guides/how-to-guides/cross-channel-tracking.md b/src/guides/how-to-guides/cross-channel-tracking.md index d176294ad1..4965ec19e8 100644 --- a/src/guides/how-to-guides/cross-channel-tracking.md +++ b/src/guides/how-to-guides/cross-channel-tracking.md @@ -6,11 +6,11 @@ The paths consumers take to your app or website are more complex than ever, ofte But these off-domain and cross-device brand interactions are equally, if not more, important to track and understand. With this data, you can identify more sources of qualified traffic and determine the best shopping experiences for conversion. -In this guide, we'll share where and how to track these critical events so that you can understand your customer's journey before they even get to your storefront, as well as their preferred shopping experiences. +In this guide, you'll learn where and how to track these critical events so that you can understand your customer's journey before they even get to your storefront, as well as their preferred shopping experiences. -_If you're interested in learning about what to track,_ [check out our guide on creating an e-commerce tracking plan](/docs/connections/spec/ecommerce-tracking-plan/). +If you're interested in learning about what to track, [check out Segment's guide on creating an e-commerce tracking plan](/docs/connections/spec/ecommerce-tracking-plan/). -[Talk to a product specialist today](https://segment.com/contact/sales) about building a clean, high-quality data spec so you can focus on brand engagement and sales growth. +[Talk to a product specialist today](https://segment.com/contact/sales){:target="_blank"} about building a clean, high-quality data spec so you can focus on brand engagement and sales growth. ## Where are they coming from? Off-domain tracking @@ -25,17 +25,18 @@ Digital marketing consists of owned marketing, earned marketing, and paid market | Earned (blogs, PR, partners, news) | UTM params, deep links on mobile | | Paid aquisition | UTM params, deep links on mobile | -"Owned" marketing encompasses all activities you have full control over. It can be further split into first- and second-party data. First-party data is customer data generated on your site or in your app. Second-party data is customer data generated when your customers interact with your email or push notifications (e.g. "Email Opened", "Push Notification Received"). +**Owned** marketing encompasses all activities you have full control over. It can be further split into first- and second-party data. First-party data is customer data generated on your site or in your app. Second-party data is customer data generated when your customers interact with your email or push notifications (for example, "Email Opened" or "Push Notification Received"). -"Earned" marketing is when publications, newsletters or blogs organically create some content that refers to or promotes you. +**Earned** marketing is when publications, newsletters, or blogs organically create some content that refers to, or promotes you. -Paid acquisition, like display ads or embedded advertorials, don't exist on your domain. To track the inbound traffic from both "earned" and paid acquisition sources, we use UTM parameters (and deep links if you're directing a customer to a specific screen in your mobile app that has the product to purchase). +**Paid acquisition**, like display ads or embedded advertorials, don't exist on your domain. To track the inbound traffic from both "earned" and paid acquisition sources, Segment uses UTM parameters (and deep links if you're directing a customer to a specific screen in your mobile app that has the product to purchase). **Track engagement on your email channels** -While these are still under "owned" marketing, they happen off your domain. An example is sending an engagement email to your customer base with a call-to-action to visit your store. If you're using Segment and an email or push notification tool on our platform, you can easily collect second-party data such as "Email Sent" and "Push Notification Opened". +While these are still under "owned" marketing, they happen off your domain. An example is sending an engagement email to your customer base with a call-to-action to visit your store. If you're using Segment and an email or push notification tool on Segment's platform, you can easily collect second-party data such as "Email Sent" and "Push Notification Opened". -_Learn more about which_ [email](https://segment.com/catalog#integrations/email) and [push notification tools](https://segment.com/catalog#integrations/push-notifications) _are supported on Segment._ +> success "" +> Learn more about which [email](https://segment.com/catalog#integrations/email){:target="_blank"} and [push notification tools](https://segment.com/catalog#integrations/push-notifications){:target="_blank"} Segment supports. Here are some of the most commonly used and popular events tracked through email and push notifications on Segment: @@ -52,7 +53,7 @@ Here are some of the most commonly used and popular events tracked through email If your email tool is not supported on Segment, you can still track email opens with Segment's tracking pixel. This pixel functions like an advertising pixel in that it embeds an image onto pages where JavaScript and POST requests are disabled. -[A list of supported tools on Segment.](https://segment.com/catalog/) +[View a list of tools Segment supports](https://segment.com/catalog/){:target="_blank"}. In your email template HTML, include an image tag where the `src` is a URL that is carefully constructed to hit Segment's appropriate endpoint with a JSON payload that is base64 encoded. @@ -82,7 +83,7 @@ Add the complete URL as the `src` in the image tag. ``` -[Learn more about our Pixel API.](/docs/connections/sources/catalog/libraries/server/pixel-tracking-api/) +[Learn more about Segment's Pixel API.](/docs/connections/sources/catalog/libraries/server/pixel-tracking-api/) **Track earned traffic with UTM Parameters** @@ -90,25 +91,25 @@ UTM parameters are types of query strings added to the end of a URL. When clicke ![Diagram showing how different UTM parameters redirect to your site and then are displayed in Traffic analytics.](images/x-channel_GWqnp2I6.png) -UTM parameters are only used when linking to your site from outside of your domain. When a visitor arrives to your site using a link containing UTM parameters, Segment's client-side analytics.js library will automatically parse the URL's query strings, and store them within the `context` object as outlined [here](https://segment.com/docs/connections/spec/common/#context-fields-automatically-collected). These parameters do not persist to subsequent calls unless you pass them explicitly. +UTM parameters are only used when linking to your site from outside of your domain. When a visitor arrives to your site using a link containing UTM parameters, Segment's client-side analytics.js library will automatically parse the URL's query strings, and store them within the `context` object as outlined [here](/docs/connections/spec/common/#context-fields-automatically-collected). These parameters do not persist to subsequent calls unless you pass them explicitly. UTM parameters contain three essential components: -* **utm\_campaign**: this is the name of your campaign. All marketing activities that support this campaign, needs to have the same utm\_campaign so that downstream analysis to measure performance for this specific campaign can be done off this primary key. Examples: "national-toastday" +* **utm\_campaign**: this is the name of your campaign. All marketing activities that support this campaign, needs to have the same utm\_campaign so that downstream analysis to measure performance for this specific campaign can be done off this primary key. (Example: "national-toastday") -* **utm\_medium**: how the traffic is coming to your site? Is it through email, a display ad, an online forum? This ensures our downstream analysis can easily see which channel performs the best. Examples: "email", "paid-display", "paid-social", "organic-social" +* **utm\_medium**: how the traffic is coming to your site. Is it through email, a display ad, or an online forum? This ensures Segment's downstream analysis can easily see which channel performs the best. (Examples: "email", "paid-display", "paid-social", "organic-social") -* **utm\_source**: where is the traffic specifically coming from? You can be specific here. This ensures our downstream analysis can measure which specific source brings the most conversions. Examples: "twitter", "customer.io" (email tool), "facebook", "adroll". +* **utm\_source**: where is the traffic specifically coming from. You can be specific here. This ensures Segment's downstream analysis can measure which specific source brings the most conversions. (Examples: "twitter", "customer.io" (email tool), "facebook", "adroll") With these being optional: -* **utm\_content**: for multiple calls to action on a single page, utm\_content indicates which one. For example, on a website, there may be three different display ads. While the link on each display ad will have the same utm\_campaign, utm\_medium, and utm\_source, the utm\_content will be different. Examples: "banner", "left-side", "bottom-side" +* **utm\_content**: for multiple calls to action on a single page, utm\_content indicates which one. For example, on a website, there may be three different display ads. While the link on each display ad will have the same utm\_campaign, utm\_medium, and utm\_source, the utm\_content will be different. (Examples: "banner", "left-side", "bottom-side") -* **utm\_term**: this is the parameter suggested for paid search to identify keywords for your ad. If you're using Google Adwords and have enabled "autotagging", then you don't need to worry about this. Otherwise, you can manually pass the keywords from your search terms through this parameter so that you can see which keywords convert the most. Note that this parameter is reserved explicitly for search. Examples: "toast", "butter", "jam". +* **utm\_term**: this is the parameter suggested for paid search to identify keywords for your ad. If you're using Google Adwords and have enabled "autotagging", then you don't need to worry about this. Otherwise, you can manually pass the keywords from your search terms through this parameter so that you can see which keywords convert the most. Note that this parameter is reserved explicitly for search. (Examples: "toast", "butter", "jam") -[Learn more about the semantics with each UTM parameter.](https://docs.google.com/file/d/0By71e2L6SonANjViYWUyOTktOGQ2Ny00NWJmLThlY2MtMDU3MzJhNWU0MDg1/edit?hl=en) _The key isn't to stick with the definitions that closely, but to be consistent within your own analytics system._ +[Learn more about the semantics with each UTM parameter.](https://docs.google.com/file/d/0By71e2L6SonANjViYWUyOTktOGQ2Ny00NWJmLThlY2MtMDU3MzJhNWU0MDg1/edit?hl=en){:target="_blank"} _The key isn't to stick with the definitions that closely, but to be consistent within your own analytics system._ **Proper UTMs use** @@ -138,7 +139,7 @@ Your UTM parameters would match a pattern such as * if you were using paid search, the term would be utm\_term -An example would be a National Toast Day campaign. This campaign would include emails, paid acquisition (via AdRoll and Facebook Ads), organic social (Twitter), and promotional content on partners' blogs. +An example would be a National Toast Day campaign. This campaign would include emails, paid acquisition (with AdRoll and Facebook Ads), organic social (Twitter), and promotional content on partners' blogs. @@ -152,24 +153,24 @@ An example would be a National Toast Day campaign. This campaign would include e Having the consistent UTM parameters naming convention simplifies the downstream analysis and the ease of querying across dimensions, such as within the campaign, which medium or source was the best. Or which placement of the display ad led to the most conversions. -[Learn more about measuring ROI of marketing campaigns with SQL and UTM parameters.](https://segment.com/docs/guides/how-to-guides/measure-marketing-roi/) +[Learn more about measuring ROI of marketing campaigns with SQL and UTM parameters.](/docs/guides/how-to-guides/measure-marketing-roi/) ## What device are they using? Cross-device tracking -It's common for customers to discover you on their desktop before making the purchase much later on their phone. How do we tie all of these events back to the same customer so we can understand which marketing activities on what screens are responsible for conversions? +It's common for customers to discover you on their desktop before making the purchase much later on their phone. How do you tie all of these events back to the same customer so you can understand which marketing activities on what screens are responsible for conversions? **Track server-side when possible** -Tracking with JavaScript in the browser has its benefits, such as leveraging browser technologies to automatically track things like UTM parameters, referring domain, IP address, and user agent. But here are a few reasons why it might make sense for your store to track on the server side. +Tracking with JavaScript in the browser has its benefits, such as using browser technologies to automatically track things like UTM parameters, referring domain, IP address, and user agent. But here are a few reasons why it might make sense for your store to track on the server side. * Are your customers technically savvy and use ad blockers? Ad blockers restrict requests from a list of blocklisted domains to your browser, which means that none of your event tracking will work properly. If you sell to a technical audience, it is possible that you may be underreporting your analytics by a material amount. * Do you have multiple devices? If you have multiple devices with the same customer check out flow, moving those events to the server-side will reduce your surface area of your code base. This means less maintenance and faster changes. -[Learn more about client vs server tracking.](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/) +[Learn more about client vs server tracking](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/){:target="_blank"}. -If you do move key checkout events to the server side, you will have to manually send the data automatically collected by our client-side JavaScript library to your server. These pieces of tracking data are still important for the following reasons: +If you do move key checkout events to the server side, you will have to manually send the data automatically collected by Segment's client-side JavaScript library to your server. These pieces of tracking data are still important for the following reasons: * **UTM parameters**: collecting the UTM params will allow you to tie conversion events to your marketing campaign or activities. This is valuable in that you can immediately measure performance and calculate ROI on your campaigns. @@ -178,17 +179,17 @@ If you do move key checkout events to the server side, you will have to manually * **User Agent**: the User Agent will inform you of your customers' preferred device and shopping experience. Are they converting on a mobile web browser? Native app? Or on their laptop? -[Learn how to use](https://segment.com/docs/connections/spec/common/#context) [`context`](https://segment.com/docs/connections/spec/common/#context) [to manually send this information on the server side.](https://segment.com/docs/connections/spec/common/#context) +[Learn how to use`context`](/docs/connections/spec/common/#context) to manually send this information on the server side. **Track the same user across devices** If your store allows user registration and users are logged in when they shop on your site or app, then you can track them across devices. -This works by using a `userId` instead of an `anonymousId` to track key events and where they occur. This `userId` serves as the primary key in your downstream tools and data warehouse, allowing you to join all of her anonymous activities with her logged in ones. You also can get a complete picture of where she is and what device she is on, while she is using your apps or website. +This works by using a `userId` instead of an `anonymousId` to track key events and where they occur. This `userId` serves as the primary key in your downstream tools and data warehouse, allowing you to join all of a profile's anonymous activities with logged in activities. You also can get a complete picture of a profiles location, and what device they are on while using your app or website. -[Learn more about pulling the entire user journey for a single user given a userId.](https://segment.com/docs/guides/how-to-guides/join-user-profiles/) +[Learn more about pulling the entire user journey for a single user given a userId.](/docs/guides/how-to-guides/join-user-profiles/) -Unfortunately, tracking the same user across devices only works if she logs into each device. Anonymous browsing in each distinct "experience" (e.g. mobile safari, native iPhone, browser on laptop) generates its own unique `anonymousId` . Each `anonymousId` is limited to the scope of that browser or app, only measuring activities in those sessions. It's not until the user logs in when the `userId` is generated (if she is registering for a new account) or the `userId` is retrieved from your database, and then mapped to the `anonymousId` of that session. Segment will keep a table of `anonymousId` s mapped to a single `userId`so you can analyze a user's activity across multiple devices. +Unfortunately, tracking the same user across devices only works if they log in to each device. Anonymous browsing in each distinct "experience" (for example, mobile safari, native iPhone, browser on laptop) generates its own unique `anonymousId` . Each `anonymousId` is limited to the scope of that browser or app, only measuring activities in those sessions. It's not until the user logs in when the `userId` is generated (if registering for a new account) or the `userId` is retrieved from your database, and then mapped to the `anonymousId` of that session. Segment keeps a table of `anonymousId`s mapped to a single `userId` so you can analyze a user's activity across multiple devices. If a user logs in on multiple devices, then you would be able to analyze even the anonymous activity across those devices. Consequently, it's important to encourage your users to log in so that you have this capability. @@ -196,22 +197,22 @@ If a user logs in on multiple devices, then you would be able to analyze even th One of the biggest challenges for brick-and-mortar stores is to measure the impact of their online advertising campaigns on their in-store purchases. Attributing offline conversions has traditionally been difficult to achieve, due to the lack of offline data and robust infrastructure to route that data. -For Facebook advertisers, [Facebook Offline Conversions](https://www.facebook.com/business/help/1782327938668950) allow you to tie offline conversions to your campaigns. It's important to note that the offline data is labeled to an event set that has been assigned to a Facebook campaign. Here are the two ways to attribute offline conversions to Facebook advertisements: +For Facebook advertisers, [Facebook Offline Conversions](https://www.facebook.com/business/help/1782327938668950){:target="_blank"} allow you to tie offline conversions to your campaigns. It's important to note that the offline data is labeled to an event set that has been assigned to a Facebook campaign. Here are the two ways to attribute offline conversions to Facebook advertisements: * uploading offline event data about actions that aren't captured with Facebook Pixel or App Events to Facebook for them to match actions to your Facebook ads * enable and configure [Segment's Facebook Offline Conversions destination](/docs/connections/destinations/catalog/facebook-offline-conversions/), which automates attributing offline events to your Facebook ads in real-time -[Learn more about the benefits of Segment's Facebook Offline Conversions destination.](https://segment.com/blog/facebook-offline-conversions-integration/) +[Learn more about the benefits of Segment's Facebook Offline Conversions destination](https://segment.com/blog/facebook-offline-conversions-integration/){:target="_blank"}. Most other advertising networks provide some functionality of manually uploading offline data to match with their online advertising data. Here is a short list of other services: -* [Google Adwords](https://adwords.google.com/home/) provides the functionality to [attribute offline conversions to your ads](https://support.google.com/adwords/answer/2998031?hl=en). +* [Google Adwords](https://adwords.google.com/home/){:target="_blank"} provides the functionality to [attribute offline conversions to your ads](https://support.google.com/adwords/answer/2998031?hl=en){:target="_blank"}. -Being able to attribute in-store purchases to an impression from a display ad online is critical to help marketers and advertisers understand which campaigns or creatives are driving sales. The more real-time the data and insights, the more nimble your business can be in altering course so that additional resources can be put towards the right marketing actions. +Attributing in-store purchases to an impression from a display ad online is critical to help marketers and advertisers understand which campaigns or creatives are driving sales. The more real-time the data and insights, the more nimble your business can be in altering course so that additional resources can be put towards the right marketing actions. ## Learn about the funnel before your website or app @@ -219,4 +220,4 @@ The internet has made it easy for customers to come from nearly anywhere to your By tracking in these locations with the above mentioned techniques, your downstream analysis will also be simpler. With UTM params, you'll be able to quickly measure the performance of a campaign or a particular channel. By properly tracking on multiple devices, you can understand which shopping experiences are most preferred. These tracking techniques are invaluable to understanding the source of your highest quality customers. -[Talk to a product specialist today](https://segment.com/contact/sales) _about building a clean, high-quality data spec so you can focus on brand engagement and sales growth._ +[Talk to a product specialist today](https://segment.com/contact/sales){:target="_blank"} about building a clean, high-quality data spec so you can focus on brand engagement and sales growth. diff --git a/src/guides/how-to-guides/dynamic-coupon-program.md b/src/guides/how-to-guides/dynamic-coupon-program.md index 9ed0e0c9ce..c70ffa2ad1 100644 --- a/src/guides/how-to-guides/dynamic-coupon-program.md +++ b/src/guides/how-to-guides/dynamic-coupon-program.md @@ -6,33 +6,33 @@ One component of building a successful and engaging e-commerce brand is rewardin This guide will walk you through setting up a dynamic and automated coupon program based on conditions that define your most valuable customers, as well as how to measure the program's performance. -[Talk to a product specialist today](https://segment.com/contact/sales) about using data to tailor your brand experience. +[Talk to a product specialist today](https://segment.com/contact/sales){:target="_blank"} about using data to tailor your brand experience. ## Tools used -* Emails with [Customer.io](https://customer.io/): _Customer.io is a flexible email provider that allows you to create cohorts based on customer actions. You can build complex onboarding emails, nurture email campaigns, as well as marketing automation workflows._ +* Emails with [Customer.io](https://customer.io/){:target="_blank"}: Customer.io is a flexible email provider that allows you to create cohorts based on customer actions. You can build complex onboarding emails, nurture email campaigns, as well as marketing automation workflows. -* Retention Analytics with [Amplitude](https://amplitude.com/): _Amplitude is an analytics tool that focuses on understanding retention and funnel analysis_ +* Retention Analytics with [Amplitude](https://amplitude.com/){:target="_blank"}: Amplitude is an analytics tool that focuses on understanding retention and funnel analysis. -Before we proceed, it's important to register for these tools and enable them on your Segment source project. When Segment collects tracking data, it routes it to all of your enabled tools, meaning that they get a single consistent data set. Most importantly, the data generated by users interacting with emails is sent through Segment so you can analyze email performance, and how it impacts conversion with Amplitude. +It's important to register for these tools and enable them on your Segment source project. When Segment collects tracking data, it routes it to all of your enabled tools, meaning that they get a single consistent data set. Most importantly, the data generated by users interacting with emails is sent through Segment so you can analyze email performance, and how it impacts conversion with Amplitude. **Not using Customer.io or Amplitude?** Check out the other Segment Supported [Email Marketing](/docs/connections/destinations/catalog/#email-marketing) and [Analytics tools](/docs/connections/destinations/catalog/#analytics). ## The Loyalty Program -As the marketing manager of our fictitious, on-demand artisanal toast company, Toastmates, I want to experiment with a coupon program to retain our best customers. +Say, as the marketing manager of our fictitious, on-demand artisanal toast company, Toastmates, you want to experiment with a coupon program to retain your best customers. -Through a combination of SQL and statistical analysis on a set of historical data, we've identified the conditions for our most valuable customers as: +Through a combination of SQL and statistical analysis on a set of historical data, you've identified the conditions for our most valuable customers as: * shops over twice a month * pays over $20 per order -_Learn how we defined these conditions in_ [How to Forecast LTV for e-commerce with Excel and SQL.](https://segment.com/docs/guides/how-to-guides/forecast-with-sql/) +Learn how to define these conditions in [How to Forecast LTV for e-commerce with Excel and SQL](/docs/guides/how-to-guides/forecast-with-sql/). -Will rewarding a $5 coupon to this cohort after they make the second purchase a month lead to higher engagement and LTV? We'll set up this program using Customer.io as the email provider and measure it's performance on engagement and LTV with Amplitude. +Will rewarding a $5 coupon to this cohort after they make the second purchase a month lead to higher engagement and LTV? Set up this program using Customer.io as the email provider and measure it's performance on engagement and LTV with Amplitude. -We'll conduct a split test (half of the cohort will represent the control group and will not receive any emails; the other half will receive an email with the $5 coupon) for one month. After which, we'll use Amplitude to see if there were any correlations between the coupon email and conversions. +Conduct a split test (half of the cohort will represent the control group and will not receive any emails; the other half will receive an email with the $5 coupon) for one month. After which, use Amplitude to see if there were any correlations between the coupon email and conversions. ## Set it up @@ -40,44 +40,42 @@ First, register for an account with Customer.io and Amplitude. Then, enable Cust ![Screenshot of the Streaming Data Out page in Customer.io, with an enabled Segment.com option.](images/dyncoupon_tps7HAgP.png) -[You can find those destination settings in Customer.io here.](https://fly.customer.io/account/integration_settings) +[You can find those destination settings in Customer.io here](https://fly.customer.io/account/integration_settings){:target="_blank"}. When everything is enabled, customer event data such as `Order Completed` and `Product Added`, as well as their properties, will all be sent to your configured destinations, including Customer.io and Amplitude. Then you can define cohorts based on these events in Customer.io to add to email campaigns or conduct funnel analytics in Amplitude. -[Talk to a product specialist to learn what else you can accomplish with these tools.](https://segment.com/contact/sales) +[Talk to a product specialist to learn what else you can accomplish with these tools](https://segment.com/contact/sales){:target="_blank"}. ## Define the cohort in Customer.io -Now we define the specific cohort in Customer.io as per our conditions listed earlier: someone who spends over $20 per order and shops over twice a month. In Customer.io, go to "Segments" and "Create Segment": +Now define the specific cohort in Customer.io as per our conditions listed earlier: someone who spends over $20 per order and shops over twice a month. In Customer.io, go to "Segments" and "Create Segment": ![Screenshot of the Segment builder in Customer.io, with the title "Coupon Loyalty Experiment".](images/dyncoupon_kTaK5L7l.png) -After this cohort is created, then when a customer makes the third purchase in a month and it's over $20, then she will be added to this segment. +After this cohort is created, then when a customer makes the third purchase in a month and it's over $20, they will be added to this segment. -Next, we'll create a "segment trigger campaign", where Customer.io will send a message the first time someone enters a segment. The segment in this case will be the one we just created: Coupon Loyalty Experiment. +Next, create a "segment trigger campaign", where Customer.io will send a message the first time someone enters a segment. The segment in this case will be the one you just created: Coupon Loyalty Experiment. ![Screenshot of the Segment Trigger Campaign page in Customer.io, with a sample email ready to send to customers in the segment.](images/dyncoupon_lE6v8cXN.png) -Save the changes and then enable the campaign! - -Then, make sure that your e-commerce backend is set up properly to handle the coupons. If it's available in your system, create a coupon that only works for a specific set of customers. +Save the changes and enable the campaign. Then, make sure that your e-commerce backend is set up properly to handle the coupons. If it's available in your system, create a coupon that only works for a specific set of customers. ## Measure performance -After a month has passed for our split test, we can then measure the performance of the email coupon program to see whether it's making a material impact on conversions. +After a month has passed for the split test, you can measure the performance of the email coupon program to see whether it's making a material impact on conversions. -In Amplitude, we can create a funnel that compares the two cohorts—one who received this coupon email vs. the control group who did not—and see its impact on conversions and revenue generated. +In Amplitude, create a funnel that compares the two cohorts—one who received this coupon email vs. the control group who did not—and see its impact on conversions and revenue generated. -First, let's define a behavioral cohort with the conditions of being loyal customers so we can use it when we analyze the conversion funnel: +First, define a behavioral cohort with the conditions of being loyal customers so you can use it when analyzing the conversion funnel: ![Screenshot of a Loyal Customers segment in Amplitude, comprised of users who spent at least $20 and purchased more than two times in the last 30 days](images/dyncoupon_uiJaB5iF.png) -We'll also have to create a second identical cohort, except with the only difference that these customers did not receive the coupon email. We need this cohort so we can create the conversion funnel with the control group. +You'll also have to create a second identical cohort, except with the only difference that these customers did not receive the coupon email. You need this cohort to create the conversion funnel with the control group. ![Screenshot of a Loyal Customers (Control) segment in Amplitude, comprised of users who spent at least $20 and purchased more than two times in the last 30 days, but did not get the loyal customer email.](images/dyncoupon_vt165Rxc.png) -After we've created these two cohorts, we'll create two funnel charts. The first funnel will look at the control group. The second funnel will look at the group that received the coupon email. +After you've created these two cohorts, create two funnel charts. The first funnel will look at the control group. The second funnel will look at the group that received the coupon email. ![Screenshot of the Funnel Analysis page in Amplitude showing the Loyal Customers (Control) segment.](images/dyncoupon_2IEwSA4L.png) @@ -85,7 +83,7 @@ Resulting in: ![A bar chart showing 233 visits to the main landing screen, 98 products added to cart, and 66 purchases.](images/dyncoupon_kEDuPed8.png) -We can see that the control group that did not receive the email for the coupon resulted in 233 people visiting the store, with 66 conversions. +The control group that did not receive the email for the coupon resulted in 233 people visiting the store, with 66 conversions. The funnel for the group who did receive the emails can be created with these parameters: @@ -95,11 +93,11 @@ Resulting in: ![A bar chart showing 758 emails delivered, 560 emails opened, 168 visits to the main landing screen, 134 products added to cart, and 95 purchases.](images/dyncoupon_TUWSroDC.png) -The email itself drove 168 customers to the store, which also saw higher conversions to `Product Added` and ultimately `Order Completed` . +The email itself drove 168 customers to the store, which also saw higher conversions to `Product Added` and ultimately `Order Completed`. Note that this funnel is only looking customers who went through these events in this specific order. This analysis doesn't consider customers who are part of the emailed cohort, yet didn't open the email, but still visited the site and/or made a purchase. -At first glance, it appears that the group that was emailed did receive an absolute number of more conversions. However, these funnels are still inconclusive, given that we haven't explored the impact on the top line revenue, as well as overall engagement with the brand. Fortunately, we can continue to use Amplitude to analyze impact on revenue itself, though we won't go into detail here. +At first glance, it appears that the group that was emailed did receive an absolute number of more conversions. However, these funnels are still inconclusive, given that you haven't explored the impact on the top line revenue, as well as overall engagement with the brand. Fortunately, you can continue to use Amplitude to analyze impact on revenue itself. ## Find new ways and channels to retain your most valuable customers @@ -107,6 +105,6 @@ Retaining and rewarding your customers is paramount to a strong and engaging bra Other ideas can be to send messages to your customers with a referral code to invite their friends. Or set up a coupon for customers who are just shy of entering your most valuable customers cohort. Or, if you're hosting a pop up shop event, sending a special and personalized invite to your strongest users first, as a way to thank them for their business. -The possibilities are endless! We're excited to see how you use your customer data to drive sales. +The possibilities are endless when you use your customer data to drive sales. -[Talk to a product specialist today](https://segment.com/contact/sales) _about using data to tailor your brand experience._ +[Talk to a product specialist today](https://segment.com/contact/sales){:target="_blank"} about using data to tailor your brand experience. diff --git a/src/guides/how-to-guides/forecast-with-sql.md b/src/guides/how-to-guides/forecast-with-sql.md index 88abffba12..0951478a6d 100644 --- a/src/guides/how-to-guides/forecast-with-sql.md +++ b/src/guides/how-to-guides/forecast-with-sql.md @@ -8,29 +8,29 @@ The LTV calculation is not straightforward for e-commerce businesses, since futu This guide shows how to calculate forward-looking LTV for non-contractual businesses using SQL and Excel. This analytical approach allows you to accurately rank your highest value customers, as well as predict their future purchase sizes to help focus your marketing efforts. -In this guide, we assume that you're using the tracking scheme we described in [How to implement an e-commerce tracking plan](/docs/connections/spec/ecommerce-tracking-plan/) and are storing data in a [Segment Warehouse](https://segment.com/warehouses). +This guide assumes you're using the tracking schema described in [How to implement an e-commerce tracking plan](/docs/connections/spec/ecommerce-tracking-plan/) and are storing data in a [Segment Warehouse](https://segment.com/warehouses){:target="_blank"}. [Talk to a product specialist](https://segment.com/contact/sales) to learn how companies like Warby Parker and Crate & Barrel use a data warehouse to increase engagement and sales. ## Calculating LTV: Buy 'Til You Die -In a non-contractual setting, we can't use a simple retention rate to determine when customers terminate their relationship. This is because the retention rate is a linear model that doesn't accurately predict whether a customer has ended her relationship with the company or is merely in the midst of a long hiatus between transactions. +In a non-contractual setting, you can't use a simple retention rate to determine when customers terminate their relationship. This is because the retention rate is a linear model that doesn't accurately predict whether a customer has ended her relationship with the company or is merely in the midst of a long hiatus between transactions. The most accurate non-contractual LTV model, named "Buy Til You Die" ("BTYD"), focuses on calculating the discounted estimation of future purchases based on recency of last purchase, frequency of purchases, and average purchase value. This model uses non-linear modeling to predict whether or not a user is "alive" or "dead" given historic transactions to forecast future probability and size of purchases. Since LTV is a critical metric for e-commerce companies, it's important that this model, instead of simpler linear formula that is based on retention rates, is used for it's calculation. -We'll first use SQL to build the necessary table, which will be exported as a CSV and opened in Google Sheets. Then, we'll use Solver to estimate the predictive model parameters, which ultimately calculate the future purchases of each customer. Finally, the LTV calculation is simply the net present value of each customer's future purchases. We will rank them by LTV, then find behavioral patterns across our top 10 or 50 customers to figure out how best to target or retain this cohort. +Use SQL to build the necessary table, which will be exported as a CSV and opened in Google Sheets. Then, use Solver to estimate the predictive model parameters, which ultimately calculates the future purchases of each customer. Finally, the LTV calculation is simply the net present value of each customer's future purchases. Rank them by LTV, then find behavioral patterns across the top 10 or 50 customers to figure out how best to target or retain this cohort. -**Recency, Frequency, and Average Size** +**Recency, frequency, and average size** -As a growth analyst at our fictitious on-demand artisanal toast company, Toastmates, we want to know which customers are worth more to the business than others. Most important, we'd like to understand what similarities these customers all have to help guide our marketing team in their efforts. +As a growth analyst at the fictitious on-demand artisanal toast company, Toastmates, it's important to know which customers are worth more to the business than others. Most important, you should understand what similarities these customers all have to help guide the marketing team in their efforts. -The first step in creating the BTYD model is to get historic purchasing data of at least a month. In our analysis, we'll use data from the past six months. The data must include the columns `userId` (email is cool, too, which we'll use in our example below), number of purchases within the specified time window, days since last purchase, and days since first purchase. +The first step in creating the BTYD model is to get historic purchasing data of at least a month. In your analysis, you can use data from the past six months. The data must include the columns `userId` (email is fine too), number of purchases within the specified time window, days since last purchase, and days since first purchase. -Then, we'll use [this Google Sheet](https://docs.google.com/spreadsheets/d/1GteY4X443TLaMfJWvEiC4hHVdLyHiGaA5aGgHCYkmQM/edit#gid=0), which provides all of the complex calculations for estimating the model parameters, as well as forecasting the future sales of each customer. This sheet is View Only, so be sure to copy it entirely so you can use it. +Then, use [this Google Sheet](https://docs.google.com/spreadsheets/d/1GteY4X443TLaMfJWvEiC4hHVdLyHiGaA5aGgHCYkmQM/edit#gid=0), which provides all of the complex calculations for estimating the model parameters, as well as forecasting the future sales of each customer. This sheet is View Only, so be sure to copy it entirely so you can use it. -To retrieve a table with the right columns for analysis, let's use the follow SQL query: +To retrieve a table with the right columns for analysis, use the follow SQL query: ```sql     with @@ -115,27 +115,27 @@ After Solver runs, cells B1:B4 will be updated to represent the model's estimate The model requires four pieces of information about each customer's past purchasing history: her "recency" (how many "time units" her last transaction occurred), "frequency" (how many transactions she made over the specified time period), the length of time over which we have observed her purchasing behavior, and the average transaction size. -In our example, we have the purchasing behavior data over the course of six months with each unit of time being a single day. +In the example, you have the purchasing behavior data over the course of six months with each unit of time being a single day. -We'll apply a both a beta-geometric and a negative binomial distribution ("BG/NBD") to these inputs and then use Excel to estimate the model parameters (an alternative would be the Pareto/NBD model). These probability distributions are used because they accurately reflect the underlying assumptions of the aggregation of realistic individual buying behavior. ([Learn more about these models](http://www.brucehardie.com/notes/021/palive_for_BGNBD.pdf)). +You can apply a both a beta-geometric and a negative binomial distribution ("BG/NBD") to these inputs and then use Excel to estimate the model parameters (an alternative would be the Pareto/NBD model). These probability distributions are used because they accurately reflect the underlying assumptions of the aggregation of realistic individual buying behavior. ([Learn more about these models](http://www.brucehardie.com/notes/021/palive_for_BGNBD.pdf)). -After estimating the model parameters, we'll predict a particular customer's conditional expected transactions by applying the same historic purchasing data to Bayes' Theorem, which describes the probability of an event based on prior knowledge of conditions related to the event. +After estimating the model parameters, you can predict a particular customer's conditional expected transactions by applying the same historic purchasing data to Bayes' Theorem, which describes the probability of an event based on prior knowledge of conditions related to the event. **Estimating the model parameters** -The top left part of the first sheet represent the parameters of the BG/NBD model that must be fitted to the historic data you paste in. These four parameters (r, alpha, a, and b) will have "starting values" of 1.0, since we'll use Excel Solver to determine their actual values. +The top left part of the first sheet represent the parameters of the BG/NBD model that must be fitted to the historic data you paste in. These four parameters (r, alpha, a, and b) will have "starting values" of 1.0, since you'll use Excel Solver to determine their actual values. The values in columns F to J represent variables in the BG/NBD model. Column F, in particular, defines a single customer's contribution to a the overarching function, on which we'll use Solver to determine the parameters. In statistics, this function is called the likelihood function, which is a function of the parameters of a statistical model. -In this particular case, this function is the log-likelihood function, which is B5, as calculated as the sum of all cells in column F. Logarithmic functions are easier to work with, since they achieve its maximum value at the same points as the function itself. With Solver, we'll find the maximum value of B5 given the parameters in B1:B4. +In this particular case, this function is the log-likelihood function, which is B5, as calculated as the sum of all cells in column F. Logarithmic functions are easier to work with, since they achieve its maximum value at the same points as the function itself. With Solver, find the maximum value of B5 given the parameters in B1:B4. -With the new parameter estimates, we can now predict a customer's future purchases. +With the new parameter estimates, you can now predict a customer's future purchases. **Predicting a customer's future purchases** -In the next sheet, we apply Bayes' Theorem to the historic purchasing information to forecast the quantity of transactions in the next period. We'll then multiply the expected quantity with the average transaction size to calculate the expected revenue for that period, which we can extrapolate as an annuity, of which we can find the present discounted value (assuming discount rate is 10%). +In the next sheet, you can apply Bayes' Theorem to the historic purchasing information to forecast the quantity of transactions in the next period. Multiply the expected quantity with the average transaction size to calculate the expected revenue for that period, which you can extrapolate as an annuity, of which you can find the present discounted value (assuming discount rate is 10%). -Central to the Bayes' Theorem formula is the Gaussian hypergeometric function, which is defined by "2F1" in column M. We evaluate the hypergeometric function as if it were a truncated series: by adding terms to the series until each term is small enough that it becomes trivial. In the spreadsheet, we sum the series to it's 50th term. +Central to the Bayes' Theorem formula is the Gaussian hypergeometric function, which is defined by "2F1" in column M. Evaluate the hypergeometric function as if it were a truncated series: by adding terms to the series until each term is small enough that it becomes trivial. In the spreadsheet, we sum the series to it's 50th term. The rest of the variables in Bayes' Theorem is in columns I through L, which use the inputs from the customer's historic purchasing information, as well as the model parameter estimates as determined from Solver (cells B1:B4). @@ -188,7 +188,7 @@ This above query for user whose `user_id` is `"46X8VF96G6"` returns the below ta At Toastmates, most of the highest forward-looking expected LTV customers share one thing in common: averaging two orders per month with an average purchase size of $20. -With that in mind, we can define a behavioral cohort in our email tool, Customer.io, as well as create a trigger workflow so we can send an email offer to these customers. +With that in mind, you can define a behavioral cohort in our email tool, Customer.io, as well as create a trigger workflow so we can send an email offer to these customers. [Learn how to use email tools to target this cohort of high value customers.](https://segment.com/docs/guides/how-to-guides/forecast-with-sql//)