Package: xenon-view-sdk
xenon-view-sdkThe Xenon View Python SDK is the Python SDK to interact withXenonView.Table of contents:What's NewIntroductionSteps To Get StartedIdentify Business OutcomesIdentify Customer Journey MilestonesEnumerate Technical StackInstallationInstrument Business OutcomesInstrument Customer Journey MilestonesDetermine Commit Points(Optional) Group Customer JourneysAnalysisPerform ExperimentsDetailed UsageInstallationInitializationService/Subscription/SaaS Business OutcomesEcommerce Business OutcomesCustomer Journey MilestonesFeatures UsageContent InteractionCommit PointsHeartbeatsPlatformingExperimentsCustomer Journey GroupingOther Considerations(Optional) Error Handling(Optional) Custom Customer Journey Milestones(Optional) Journey IdentificationLicenseWhat's Newv0.1.9 - Added: Abandonment Watchdog Feature, leadAttribution outcomev0.1.8 - Added: Term for all subscriptions.v0.1.7 - Added: changed value to price.v0.1.6 - Added: Downsell, Ad, Content Archive, Subscription Pause and included price for all subscriptionsv0.1.5 - remove journeys callv0.1.4 - Rename tag to variantv0.1.3 - Readme updatev0.1.2 - typo fixedv0.1.1 - duplicates for new SDK handledv0.1.0 - SDK redesignIntroductionEveryone should have access to world-class customer telemetry.You should be able to identify the most pressing problems affecting your business quickly.
You should be able to determine if messaging or pricing, or technical challenges are causing friction for your customers.
You should be able to answer questions like:Is my paywall wording or the price of my subscriptions causing my customers to subscribe less?Is my website performance or my application performance driving retention?Is purchasing a specific product or the product portfolio driving referrals?With the correct approach to instrumentation coupled with AI-enhanced analytics, you can quickly answer these questions and much more.back to topGet Started With The Following Steps:The Xenon View SDK can be used in your application to provide a new level of customer telemetry. You'll need to embed the instrumentation into your website/application via this SDK.Instrumentation will vary based on your use case; are you offering a service/subscription (SaaS) or selling products (Ecom)?In a nutshell, the steps to get started are as follows:Identify Business Outcomes and Customer Journey Milestones leading to those Outcomes.Instrument the Outcomes/Milestones.Analyze the results.Step 1 - Business OutcomesRegardless of your business model, your first step will be identifying your desired business outcomes.Example - Service/Subscription/SaaS:Lead CaptureAccount SignupInitial SubscriptionRenewed SubscriptionUpsold SubscriptionReferralExample - Ecom:Place the product in the cartCheckoutUpsoldPurchase:memo: Note: Each outcome has an associated success and failure.Step 2 - Customer Journey MilestonesFor each Business Outcome, identify potential customer journey milestones leading up to that business outcome.Example - Service/Subscription/SaaS forLead Capture:View informational contentAsks question in the forumViews FAQsViews HowToRequests info productExample - Ecom forPlace product in cart:Search for product informationLearns about productRead reviewsStep 3 - Enumerate Technical StackNext, you will want to figure out which SDK to use. We have some of the most popular languages covered.Start by listing the technologies involved and what languages your company uses. For example:Front end - UI (Javascript - react)Back end - API server (Java)Mobile app - iPhone (Swift)Mobile app - Android (Android Java)Next, figure out how your outcomes spread across those technologies. Below are pointers to our currently supported languages:ReactNext.JsAngularHTMLPlain JavaScriptiPhone/iPadMacJavaAndroid JavaPythonFinally, continue the steps below for each technology and outcome.Step 4 - InstallationAfter you have done the prework ofStep 1andStep 2, you are ready toinstall Xenon View.
Once installed, you'll need toinitialize the SDKand get started instrumenting.Step 5 - Instrument Business OutcomesWe have provided several SDK calls to shortcut your instrumentation and map to the outcomes identified inStep 1.These calls will roll up into the associated Categories during analysis. These rollups allow you to view each Category in totality.
As you view the categories, you can quickly identify issues (for example, if there are more Failures than Successes for a Category).Service/Subscription/SaaS Related Outcome Calls(click on a call to see usage)CategorySuccessDeclineLead AttributionleadAttribution()Lead CaptureleadCaptured()leadCaptureDeclined()Account SignupaccountSignup()accountSignupDeclined()Application InstallationapplicationInstalled()applicationNotInstalled()Initial SubscriptioninitialSubscription()subscriptionDeclined()Subscription RenewedsubscriptionRenewed()subscriptionCanceled()/subscriptionPaused()Subscription UpsellsubscriptionUpsold()subscriptionUpsellDeclined()/subscriptionDownsell()Ad ClickedadClicked()adIgnored()Referralreferral()referralDeclined()Ecom Related Outcome Calls(click on a call to see usage)CategorySuccessDeclineLead AttributionleadAttribution()Lead CaptureleadCaptured()leadCaptureDeclined()Account SignupaccountSignup()accountSignupDeclined()Add To CartproductAddedToCart()productNotAddedToCart()Product Upsellupsold()upsellDismissed()CheckoutcheckedOut()checkoutCanceled()/productRemoved()Purchasepurchased()purchaseCanceled()Promise FulfillmentpromiseFulfilled()promiseUnfulfilled()Product DispositionproductKept()productReturned()Referralreferral()referralDeclined()Step 6 - Instrument Customer Journey MilestonesNext, you will want to instrument your website/application/backend/service for the identified Customer Journey MilestonesStep 2.
We have provided several SDK calls to shortcut your instrumentation here as well.During analysis, each Milestone is chained together with the proceeding and following Milestones.
That chain terminates with an Outcome (described inStep 4).
AI/ML is employed to determine Outcome correlation and predictability for the chains and individual Milestones.
During theanalysis step, you can view the correlation and predictability as well as the Milestone chains
(called Customer Journeys in this guide).Milestones break down into two types (click on a call to see usage):FeaturesContentfeatureAttempted()contentViewed()featureFailed()contentCreated()/contentEdited()featureCompleted()contentDeleted()/contentArchived()contentRequested()/contentSearched()Step 7 - Commit PointsOnce instrumented, you'll want to select appropriatecommit points. Committing will initiate the analysis on your behalf by Xenon View.Step 8 (Optional) - Group Customer JourneysAll the customer journeys (milestones and outcomes) are anonymous by default.
For example, if a Customer interacts with your brand in the following way:Starts on your marketing website.Downloads and uses an app.Uses a feature requiring an API call.Each of those journeys will be unconnected and not grouped.To associate those journeys with each other, you candeanonymizethe Customer. Deanonymizing will allow for a deeper analysis of a particular user.Deanonymizing is optional. Basic matching of the customer journey with outcomes is valuable by itself. Deanonymizing will add increased insight as it connects Customer Journeys across devices.Step 9 - AnalysisOnce you have released your instrumented code, you can head toXenonViewto view the analytics.Step 10 - Perform ExperimentsThere are multiple ways you can experiment using XenonView. We"ll focus here on three of the most common: time, platform, and variant based cohorts.Time-based cohortsEach Outcome and Milestone is timestamped. You can use this during the analysis phase to compare timeframes. A typical example is making a feature change.
Knowing when the feature went to production, you can filter in the XenonView UI based on the timeframe before and the timeframe after to observe the results.Variant-based cohortsYou can identify a journey collection as anexperimentbefore collecting data. This will allow you to run A/B testing-type experiments (of course not limited to two).
As an example, let"s say you have two alternate content/feature variants and you have a way to direct half of the users to Variant A and the other half to Variant B.
You can name each variant before the section of code that performs that journey. After collecting the data, you can filter in the XenonView UI based on each variant to
observe the results.Platform-based cohortsYou canPlatformany journey collection before collecting data. This will allow you to experiment against different platforms:Operating System NameOperating System versionDevice model (Pixel, iPhone 14, Docker Container, Linux VM, Dell Server, etc.)A software version of your application.As an example, let's say you have an iPhone and Android mobile application and you want to see if an outcome is more successful on one device verse the other.
You can platform before the section of code that performs that flow. After collecting the data, you can filter in the XenonView UI based on each platform to
observe the results.back to topDetailed UsageThe following section gives detailed usage instructions and descriptions.
It provides code examples for each of the calls.The SDK supports Python 3+.InstallationYou can install the View Python SDK fromPyPI:pipinstallxenon-view-sdkback to topInstantiationThe View SDK is a Python module you'll need to include in your application. After inclusion, you'll need to init the singleton object:fromxenon_view_sdkimportXenon# start by initializing Xenon ViewXenon('<API KEY>')-OR-fromxenon_view_sdkimportXenon# to initialize Xenon View after constructionXenon('TBD')Xenon().key('<API KEY>')Of course, you'll have to make the following modifications to the above code:Replace<API KEY>with yourapi keyback to topService/Subscription/SaaS Related Business OutcomesLead AttributedUse this call to track Lead Attribution (Google Ads, Facebook Ads, etc.)
You can add a source and identifier string to the call to differentiate as follows:leadAttributed()fromxenon_view_sdkimportXenonsource='Google Ad'identifier='Search'# Successful Lead Attributed to Google AdXenon().leadAttributed(source)#...# Successful Lead Attributed to Google Search AdXenon().leadAttributed(source,identifier)Lead CaptureUse this call to track Lead Capture (emails, phone numbers, etc.)
You can add a specifier string to the call to differentiate as follows:leadCaptured()fromxenon_view_sdkimportXenonemailSpecified="Email"phoneSpecified="Phone Number"# Successful Lead Capture of an emailXenon().leadCaptured(emailSpecified)# ...# Successful Lead Capture of a phone numberXenon().leadCaptured(phoneSpecified)leadCaptureDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonemailSpecified="Email"phoneSpecified="Phone Number"# Unsuccessful Lead Capture of an emailXenon().leadCaptureDeclined(emailSpecified)# ...# Unsuccessful Lead Capture of a phone numberXenon().leadCaptureDeclined(phoneSpecified)Account SignupUse this call to track when customers signup for an account.
You can add a specifier string to the call to differentiate as follows:accountSignup()fromxenon_view_sdkimportXenonviaFacebook="Facebook"viaGoogle="Google"viaEmail="Email"# Successful Account Signup with FacebookXenon().accountSignup(viaFacebook)# ...# Successful Account Signup with GoogleXenon().accountSignup(viaGoogle)# ...# Successful Account Signup with an EmailXenon().accountSignup(viaEmail)accountSignupDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonviaFacebook="Facebook"viaGoogle="Google"viaEmail="Email"# Unsuccessful Account Signup with FacebookXenon().accountSignupDeclined(viaFacebook)# ...# Unsuccessful Account Signup with GoogleXenon().accountSignupDeclined(viaGoogle)# ...# Unsuccessful Account Signup with an EmailXenon().accountSignupDeclined(viaEmail)Application InstallationUse this call to track when customers install your application.applicationInstalled()fromxenon_view_sdkimportXenon# Successful Application InstallationXenon().applicationInstalled()applicationNotInstalled():memo: Note: You want consistency between success and failure.fromxenon_view_sdkimportXenon# Unsuccessful or not completed Application InstallationXenon().applicationNotInstalled()Initial SubscriptionUse this call to track when customers initially subscribe.
You can add a specifier string to the call to differentiate as follows:initialSubscription()fromxenon_view_sdkimportXenontierSilver="Silver Monthly"tierGold="Gold"tierPlatium="Platium"annualSilver="Silver Annual"method="Stripe"# optionalprice='$25'#optionalterm="30d"#optional# Successful subscription of the lowest tier with StripeXenon().initialSubscription(tierSilver,method)# Successful subscription of the lowest tier with Stripe for $25 for termXenon().initialSubscription(tierSilver,method,price,term)# ...# Successful subscription to the middle tierXenon().initialSubscription(tierGold)# ...# Successful subscription to the top tierXenon().initialSubscription(tierPlatium)# ...# Successful subscription of an annual periodXenon().initialSubscription(annualSilver)subscriptionDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenontierSilver="Silver Monthly"tierGold="Gold"tierPlatium="Platium"annualSilver="Silver Annual"method="Stripe"# optionalprice='$25'# optionalterm="30d"# optional# Unsuccessful subscription of the lowest tierXenon().subscriptionDeclined(tierSilver)# ...# Unsuccessful subscription of the middle tierXenon().subscriptionDeclined(tierGold)# ...# Unsuccessful subscription to the top tierXenon().subscriptionDeclined(tierPlatium)# ...# Unsuccessful subscription of an annual period with StripeXenon().subscriptionDeclined(annualSilver,method)# Unsuccessful subscription of an annual period for $25 for termXenon().subscriptionDeclined(annualSilver,method,price,term)Subscription RenewalUse this call to track when customers renew.
You can add a specifier string to the call to differentiate as follows:subscriptionRenewed()fromxenon_view_sdkimportXenontierSilver="Silver Monthly"tierGold="Gold"tierPlatium="Platium"annualSilver="Silver Annual"method="Stripe"#optionalprice='$25'# optionalterm="30d"#optional# Successful renewal of the lowest tier with StripeXenon().subscriptionRenewed(tierSilver,method)# Successful renewal of the lowest tier with Stripe for $25 for termXenon().subscriptionRenewed(annualSilver,method,price,term)# ...# Successful renewal of the middle tierXenon().subscriptionRenewed(tierGold)# ...# Successful renewal of the top tierXenon().subscriptionRenewed(tierPlatium)# ...# Successful renewal of an annual periodXenon().subscriptionRenewed(annualSilver)subscriptionCanceled():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenontierSilver="Silver Monthly"tierGold="Gold"tierPlatium="Platium"annualSilver="Silver Annual"method="Stripe"#optionalprice='$25'# optionalterm="30d"#optional# Canceled subscription of the lowest tierXenon().subscriptionCanceled(tierSilver)# ...# Canceled subscription of the middle tierXenon().subscriptionCanceled(tierGold)# ...# Canceled subscription of the top tierXenon().subscriptionCanceled(tierPlatium)# ...# Canceled subscription of an annual period with StripeXenon().subscriptionCanceled(annualSilver,method)# Canceled subscription of an annual period with Stripe for $25Xenon().subscriptionCanceled(annualSilver,method,price,term)subscriptionPaused():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenontierSilver="Silver Monthly"tierGold="Gold"tierPlatium="Platium"annualSilver="Silver Annual"method="Stripe"#optionalprice='$25'# optionalterm="30d"#optional# Paused subscription of the lowest tierXenon().subscriptionPaused(tierSilver)# ...# Paused subscription of the middle tierXenon().subscriptionPaused(tierGold)# ...# Paused subscription of the top tierXenon().subscriptionPaused(tierPlatium)# ...# Paused subscription of an annual period with StripeXenon().subscriptionPaused(annualSilver,method)# Paused subscription of an annual period with Stripe for $25 for termXenon().subscriptionPaused(annualSilver,method,price,term)Subscription UpsoldUse this call to track when a Customer upgrades their subscription.You can add a specifier string to the call to differentiate as follows:subscriptionUpsold()fromxenon_view_sdkimportXenontierGold="Gold Monthly"tierPlatium="Platium"annualGold="Gold Annual"method="Stripe"#optionalprice='$25'# optionalterm="30d"#optional# Assume already subscribed to Silver# Successful upsell of the middle tier with StripeXenon().subscriptionUpsold(tierGold,method)# Successful upsell of the middle tier with Stripe for $25 for termXenon().subscriptionUpsold(tierGold,method,price,term)# ...# Successful upsell of the top tierXenon().subscriptionUpsold(tierPlatium)# ...# Successful upsell of middle tier - annual periodXenon().subscriptionUpsold(annualGold)subscriptionUpsellDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenontierGold="Gold Monthly"tierPlatium="Platium"annualGold="Gold Annual"method="Stripe"#optionalprice='$25'# optionalterm="30d"#optional# Assume already subscribed to Silver# Rejected upsell of the middle tierXenon().subscriptionUpsellDeclined(tierGold)# ...# Rejected upsell of the top tierXenon().subscriptionUpsellDeclined(tierPlatium)# ...# Rejected upsell of middle tier - annual periodXenon().subscriptionUpsellDeclined(annualGold,method)# Rejected upsell of middle tier - annual period with Stripe for $25 for termXenon().subscriptionUpsellDeclined(annualGold,method,price,term)subscriptionDownsell():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenontierGold="Gold Monthly"tierPlatium="Platium"annualGold="Gold Annual"method="Stripe"#optionalprice='$15'#optionalterm="30d"#optional# Assume already subscribed to Platium# Downsell to GoldXenon().subscriptionDownsell(tierGold)# ...# Downsell to Gold annual with methodXenon().subscriptionDownsell(annualGold,method)# Downsell to Gold - annual period with Stripe for $15 for termXenon().subscriptionDownsell(annualGold,method,price,term)Ad ClickedUse this call to track when customers click on an Advertisement.
You can add a specifier string to the call to differentiate as follows:adClicked()fromxenon_view_sdkimportXenonprovider="AdMob"id="ID-1234"# optionalprice="$0.25"# optional# Click an Ad from AdMobXenon().adClicked(provider)# ...# Click an Ad from AdMob identfied by ID-1234Xenon().adClicked(provider,id)# ...# Click an Ad from AdMob identfied by ID-1234 with priceXenon().adClicked(provider,id,price)adIgnored()fromxenon_view_sdkimportXenonprovider="AdMob"id="ID-1234"# optionalprice="$0.25"# optional# No action on an Ad from AdMobXenon().adIgnored(provider)# ...# No action on an Ad from AdMob identfied by ID-1234Xenon().adIgnored(provider,id)# ...# No action on an Ad from AdMob identfied by ID-1234 with priceXenon().adIgnored(provider,id,price)ReferralUse this call to track when customers refer someone to your offering.
You can add a specifier string to the call to differentiate as follows:referral()fromxenon_view_sdkimportXenonkind="Share"detail="Review"#optional# Successful referral by sharing a reviewXenon().referral(kind,detail)# -OR-Xenon().referral(kind)referralDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonkind="Share"detail="Review"#optional# Customer declined referralXenon().referralDeclined(kind,detail)# -OR-Xenon().referralDeclined(kind)back to topEcommerce Related OutcomesLead AttributedUse this call to track Lead Attribution (Google Ads, Facebook Ads, etc.)
You can add a source and identifier string to the call to differentiate as follows:leadAttributed()fromxenon_view_sdkimportXenonsource='Google Ad'identifier='Search'# Successful Lead Attributed to Google AdXenon().leadAttributed(source)#...# Successful Lead Attributed to Google Search AdXenon().leadAttributed(source,identifier)Lead CaptureUse this call to track Lead Capture (emails, phone numbers, etc.)
You can add a specifier string to the call to differentiate as follows:leadCaptured()fromxenon_view_sdkimportXenonemailSpecified="Email"phoneSpecified="Phone Number"# Successful Lead Capture of an emailXenon().leadCaptured(emailSpecified)# ...# Successful Lead Capture of a phone numberXenon().leadCaptured(phoneSpecified)leadCaptureDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonemailSpecified="Email"phoneSpecified="Phone Number"# Unsuccessful Lead Capture of an emailXenon().leadCaptureDeclined(emailSpecified)# ...# Unsuccessful Lead Capture of a phone numberXenon().leadCaptureDeclined(phoneSpecified)Account SignupUse this call to track when customers signup for an account.
You can add a specifier string to the call to differentiate as follows:accountSignup()fromxenon_view_sdkimportXenonviaFacebook="Facebook"viaGoogle="Facebook"viaEmail="Email"# Successful Account Signup with FacebookXenon().accountSignup(viaFacebook)# ...# Successful Account Signup with GoogleXenon().accountSignup(viaGoogle)# ...# Successful Account Signup with an EmailXenon().accountSignup(viaEmail)accountSignupDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonviaFacebook="Facebook"viaGoogle="Facebook"viaEmail="Email"# Unsuccessful Account Signup with FacebookXenon().accountSignupDeclined(viaFacebook)# ...# Unsuccessful Account Signup with GoogleXenon().accountSignupDeclined(viaGoogle)# ...# Unsuccessful Account Signup with an EmailXenon().accountSignupDeclined(viaEmail)Add Product To CartUse this call to track when customers add a product to the cart.
You can add a specifier string to the call to differentiate as follows:productAddedToCart()fromxenon_view_sdkimportXenonlaptop="Dell XPS"keyboard="Apple Magic Keyboard"# Successful adds a laptop to the cartXenon().productAddedToCart(laptop)# ...# Successful adds a keyboard to the cartXenon().productAddedToCart(keyboard)productNotAddedToCart():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonlaptop="Dell XPS"keyboard="Apple Magic Keyboard"# Doesn't add a laptop to the cartXenon().productNotAddedToCart(laptop)# ...# Doesn't add a keyboard to the cartXenon().productNotAddedToCart(keyboard)Upsold Additional ProductsUse this call to track when you upsell additional product(s) to customers.
You can add a specifier string to the call to differentiate as follows:upsold()fromxenon_view_sdkimportXenonlaptop='Dell XPS'laptopValue='$1459'#optionalkeyboard='Apple Magic Keyboard'keyboardValue='$139'#optional# upsold a laptopXenon().upsold(laptop)# ...# upsold a keyboard with priceXenon().upsold(keyboard,keyboardValue)upsellDismissed():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonlaptop='Dell XPS'keyboard='Apple Magic Keyboard'keyboardValue='$139'#optional# Doesn't add a laptop during upsellXenon().upsellDismissed(laptop)# ...# Doesn't add a keyboard during upsellXenon().upsellDismissed(keyboard,keyboardValue)Customer Checks OutUse this call to track when your Customer is checking out.checkedOut()fromxenon_view_sdkimportXenon# Successful CheckoutXenon().checkedOut()checkoutCanceled()fromxenon_view_sdkimportXenon# Customer cancels check out.Xenon().checkoutCanceled()productRemoved()fromxenon_view_sdkimportXenonlaptop="Dell XPS"keyboard="Apple Magic Keyboard"# Removes a laptop during checkoutXenon().productRemoved(laptop)# ...# Removes a keyboard during checkoutXenon().productRemoved(keyboard)Customer Completes PurchaseUse this call to track when your Customer completes a purchase.purchased()fromxenon_view_sdkimportXenonmethod="Stripe"price='$2011'# optional# Successful PurchaseXenon().purchased(method)# Successful Purchase for $2011Xenon().purchased(method,price)purchaseCanceled()fromxenon_view_sdkimportXenonmethod="Stripe"#optionalprice='$2011'# optional# Customer cancels the purchase.Xenon().purchaseCanceled()# -OR-Xenon().purchaseCanceled(method)# -OR-Xenon().purchaseCanceled(method,price)Purchase ShippingUse this call to track when your Customer receives a purchase.promiseFulfilled()fromxenon_view_sdkimportXenon# Successfully Delivered PurchaseXenon().promiseFulfilled()promiseUnfulfilled(()fromxenon_view_sdkimportXenon# Problem Occurs During Shipping And No DeliveryXenon().promiseUnfulfilled()Customer Keeps or Returns ProductUse this call to track if your Customer keeps the product.
You can add a specifier string to the call to differentiate as follows:productKept()fromxenon_view_sdkimportXenonlaptop="Dell XPS"keyboard="Apple Magic Keyboard"# Customer keeps a laptopXenon().productKept(laptop)# ...# Customer keeps a keyboardXenon().productKept(keyboard)productReturned():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonlaptop="Dell XPS"keyboard="Apple Magic Keyboard"# Customer returns a laptopXenon().productReturned(laptop)# ...# Customer returns a keyboardXenon().productReturned(keyboard)ReferralsUse this call to track when customers refer someone to your offering.
You can add a specifier string to the call to differentiate as follows:referral()fromxenon_view_sdkimportXenonkind="Share Product"detail="Dell XPS"# Successful referral by sharing a laptopXenon().referral(kind,detail)referralDeclined():memo: Note: You want to be consistent between success and failure and match the specifiersfromxenon_view_sdkimportXenonkind="Share Product"detail="Dell XPS"# Customer declined referralXenon().referralDeclined(kind,detail)back to topCustomer Journey MilestonesAs a customer interacts with your brand (via Advertisements, Marketing Website, Product/Service, etc.), they journey through a hierarchy of interactions.
At the top level are business outcomes. In between Outcomes, they may achieve other milestones, such as interacting with content and features.
Proper instrumentation of these milestones can establish correlation and predictability of business outcomes.As of right now, Customer Journey Milestones break down into two categories:Feature UsageContent InteractionFeature UsageFeatures are your product/application/service's traits or attributes that deliver value to your customers.
They differentiate your offering in the market. Typically, they are made up of and implemented by functions.featureAttempted()Use this function to indicate the start of feature usage.fromxenon_view_sdkimportXenonname="Scale Recipe"detail="x2"# optional# Customer initiated using a featureXenon().featureAttempted(name,detail)# -OR-Xenon().featureAttempted(name)featureCompleted()Use this function to indicate the successful completion of the feature.fromxenon_view_sdkimportXenonname="Scale Recipe"detail="x2"# optional# ...# Customer used a featureXenon().featureCompleted(name)# -OR-# Customer initiated using a featureXenon().featureAttempted(name,detail)# ...# feature code/function calls# ...# feature completes successfullyXenon().featureCompleted(name,detail)# -OR-Xenon().featureCompleted(name)featureFailed()Use this function to indicate the unsuccessful completion of a feature being used (often in the exception handler).fromxenon_view_sdkimportXenonname="Scale Recipe"detail="x2"# optional# Customer initiated using a featureXenon().featureAttempted(name,detail)try:# feature code that could failexceptExceptionase:# feature completes unsuccessfullyXenon().featureFailed(name,detail)# -OR-Xenon().featureFailed(name)back to topContent InteractionContent is created assets/resources for your site/service/product.
It can be static or dynamic. You will want to mark content that contributes to your Customer's experience or buying decision.
Typical examples:BlogBlog postsVideo assetsCommentsReviewsHowTo GuidesCharts/GraphsProduct/Service DescriptionsSurveysInformational productcontentViewed()Use this function to indicate a view of specific content.fromxenon_view_sdkimportXenoncontentType="Blog Post"identifier="how-to-install-xenon-view"# optional# Customer view a blog postXenon().contentViewed(contentType,identifier)# -OR-Xenon().contentViewed(contentType)contentEdited()Use this function to indicate the editing of specific content.fromxenon_view_sdkimportXenoncontentType="Review"identifier="Dell XPS"# optionaldetail="Rewrote"# optional# Customer edited their review about a laptopXenon().contentEdited(contentType,identifier,detail)# -OR-Xenon().contentEdited(contentType,identifier)# -OR-Xenon().contentEdited(contentType)contentCreated()Use this function to indicate the creation of specific content.fromxenon_view_sdkimportXenoncontentType="Blog Comment"identifier="how-to-install-xenon-view"# optional# Customer wrote a comment on a blog postXenon().contentCreated(contentType,identifier)# -OR-Xenon().contentCreated(contentType)contentDeleted()Use this function to indicate the deletion of specific content.fromxenon_view_sdkimportXenoncontentType="Blog Comment"identifier="how-to-install-xenon-view"# optional# Customer deleted their comment on a blog postXenon().contentDeleted(contentType,identifier)# -OR-Xenon().contentDeleted(contentType)contentArchived()Use this function to indicate archiving specific content.fromxenon_view_sdkimportXenoncontentType="Blog Comment"identifier="how-to-install-xenon-view"# optional# Customer archived their comment on a blog postXenon().contentArchived(contentType,identifier)# -OR-Xenon().contentArchived(contentType)contentRequested()Use this function to indicate the request for specific content.fromxenon_view_sdkimportXenoncontentType="Info Product"identifier="how-to-efficiently-use-google-ads"# optional# Customer requested some contentXenon().contentRequested(contentType,identifier)# -OR-Xenon().contentRequested(contentType)contentSearched()Use this function to indicate when a user searches.fromxenon_view_sdkimportXenoncontentType="Info Product"# Customer searched for some contentXenon().contentSearched(contentType)back to topCommit PointsBusiness Outcomes and Customer Journey Milestones are tracked locally in memory until you commit them to the Xenon View system.
After you have created (by either calling a milestone or outcome) a customer journey, you can commit it to Xenon View for analysis as follows:commit()fromxenon_view_sdkimportXenon# you can commit a journey to Xenon ViewXenon().commit()This call commits a customer journey to Xenon View for analysis.back to topHeartbeatsBusiness Outcomes and Customer Journey Milestones are tracked locally in memory until you commit them to the Xenon View system.
You can use the heartbeat call if you want to commit in batch.The heartbeat call will update a last-seen metric for customer journeys that have yet to arrive at Business Outcome.
The last-seen metric is useful when analyzing stalled Customer Journeys.Usage is as follows:heartbeat()fromxenon_view_sdkimportXenon# you can heartbeat to Xenon ViewXenon().heartbeat()This call commits any uncommitted journeys to Xenon View for analysis and updates the last accessed time.:memo: Note:Optionally, you can set abandonment timers via the watchdog parameter. This will allow you to indicate the failed to
reach outcomes if no activity is recorded before a specified timeout.Usage is as follows:heartbeat(watchdog={params})fromxenon_view_sdkimportXenon# you can set up an abandonment watchdogXenon().heartbeat(watchdog={'if_abandoned':{'superOutcome':'Checkout','outcome':'abandoned','result':'fail'},'expires_in_seconds':600,#10-mins})# you can remove an active watchdogXenon().heartbeat(watchdog={'remove':True})back to topPlatformingAfter you have initialized Xenon View, you can optionally specify platform details such as:Operating System NameOperating System versionDevice model (Pixel, Docker Container, Linux VM, Dell Server, etc.)A software version of your application.platform()fromxenon_view_sdkimportXenonsoftwareVersion="5.1.5"deviceModel="Pixel 4 XL"operatingSystemVersion="12.0"operatingSystemName="Android"# you can add platform details to outcomesXenon().platform(softwareVersion,deviceModel,operatingSystemName,operatingSystemVersion)This adds platform details for each outcome (Saas/Ecom). Typically, this would be set once at initialization:fromxenon_view_sdkimportXenonXenon().init('<API KEY>')softwareVersion="5.1.5"deviceModel="Pixel 4 XL"operatingSystemVersion="12.0"operatingSystemName="Android"Xenon().platform(softwareVersion,deviceModel,operatingSystemName,operatingSystemVersion)back to topExperimentsAfter you have initialized Xenon View, you can optionally name variants of customer journeys.
Named variants facilitate running experiments such as A/B or split testing.:memo: Note: You are not limited to just 2 (A or B); there can be many. Additionally, you can have multiple variant names.variant()fromxenon_view_sdkimportXenonvariant="subscription-variant-A"# you can add variant details to outcomesXenon().variant([variant])This adds variant names to each outcome while the variant in play (Saas/Ecom).
Typically, you would name a variant once you know the active experiment for this Customer:fromxenon_view_sdkimportXenonXenon().init('<API KEY>')experimentName=getExperiment()Xenon().variant([experimentName])resetVariants()fromxenon_view_sdkimportXenon# you can clear all variant names with the resetVariants methodXenon().resetVariants()back to topCustomer Journey GroupingXenon View supports both anonymous and grouped (known) journeys.All the customer journeys (milestones and outcomes) are anonymous by default.
For example, if a Customer interacts with your brand in the following way:Starts on your marketing website.Downloads and uses an app.Uses a feature requiring an API call.Each of those journeys will be unconnected and not grouped.To associate those journeys with each other, you can usedeanonymize(). Deanonymizing will allow for a deeper analysis of a particular user.Deanonymizing is optional. Basic matching of the customer journey with outcomes is valuable by itself. Deanonymizing will add increased insight as it connects Customer Journeys across devices.Usage is as follows:deanonymize()fromxenon_view_sdkimportXenon# you can deanonymize before or after you have committed the journey (in this case, after):person={'name':'Python Testing','email':'pytest@example.com'}Xenon().deanonymize(person)# you can also deanonymize with a user ID:person={'UUID':"<some unique ID>"}Xenon().deanonymize(person)This call deanonymizes every journey committed to a particular user.:memo: Note:With journeys that span multiple platforms (e.g., Website->Android->API backend), you can group the Customer Journeys by deanonymizing each.back to topOther OperationsThere are various other operations that you might find helpful:Error handlingIn the event of an API error, an exception occurs with the response from the API asRequests response object::memo: Note:The default handling of this situation will restore the journey (appending newly added pageViews, events, etc.) for future committing. If you want to do something special, you can do so like this:fromxenon_view_sdkimportXenon,ApiExceptiontry:Xenon().commit()exceptApiExceptionase:print(str(e.apiResponse().status_code))Custom MilestonesYou can add custom milestones if you need more than the current Customer Journey Milestones.milestone()fromxenon_view_sdkimportXenon# you can add a custom milestone to the customer journeycategory="Function"operation="Called"name="Query Database"detail="User Lookup"Xenon().milestone(category,operation,name,detail)This call adds a custom milestone to the customer journey.Journey IDsEach Customer Journey has an ID akin to a session.
After committing an Outcome, the ID remains the same to link all the Journeys.
If you have a previous Customer Journey in progress and would like to append to that, you can get/set the ID.:memo: Note:For Python, the Xenon object is a singleton. Subsequent Outcomes for multiple threads or async operations will reuse the Journey ID.After you have initialized the Xenon singleton, you can:Use the default UUIDSet the Customer Journey (Session) IDRegenerate a new UUIDRetrieve the Customer Journey (Session) IDid()fromxenon_view_sdkimportXenon# by default has Journey IDprint(str(Xenon().id()))# you can also set the idtestId='<some random uuid>'Xenon().id(testId)assertXenon().id()==testId# Lastly, you can generate a new Journey ID (useful for serialized async operations that are for different customers)Xenon().newId()back to topLicenseApache Version 2.0SeeLICENSEback to top