Customer Code
This page provides detailed instructions on the Customer Code transform code block and what should be added to the Script Manifest file in order to execute the code
Last updated
Was this helpful?
This page provides detailed instructions on the Customer Code transform code block and what should be added to the Script Manifest file in order to execute the code
Last updated
Was this helpful?
This code block is dependent on the following upstream code blocks being implemented:
Initialization
UOS
Google Analytics
Order Status
Order Channel and Marketing
Order and Order Line Revenue
The following code should be added to the main workflow in the appropriate position, after Plan to Actual and before Subscription per the page
Add this code to enable customer and retention analysis by creating the following tables:
[drp.customers
]
[drp.historical_customer_segmentation
]
[drp.customer_profiles
]
[drp.customers_fo_sku_lkp
]
[drp.retention_performance
]
[drp.sku_level_repurchase_rates
]
Create the [drp.customers
] table:
Create the [drp.historical_customer_segmentation
], which calculates the historical RFM segments, and determine last week's segment for each customer:
Create the [drp.customer_profiles
] table which summarizes customer acquisition and performance metrics:
Create a table that tracks the SKUs that a customer made in their first purchase [drp.customers_fo_sku_lkp
]
Create the [drp.retention_performance
] that tracks sales performance by segment for this month and last month
Calculate SKU repurchase rates:
Add this code if you have the Gorgias extractor implemented and you would like to be able to track the impact of Customer Service at the customer level