# Personalized Advertising in E-Commerce: Using Clickstream Data to Target High-Value Customers
## 3 Methodology for Calibrating the Customer's Value Metric
The clickstream data file used for analysis we will call Tracks DB (TDB) (see Figure 2). It contains basic information such as customer ID (CID), the URL of the visited webpage, and the date and time of the page visit. Figure 2: Clickstream data file structure and common webpage URL types (Tracks DB). According to the structure of the clickstream data file the E-shop webpage URL can describe four different types-levels of visited webpages: Group of items, Specific Item ID, Shopping Basket control page and Checkout page (Figure 2). Each type of link provides more information gathered about the selected product and stronger evidence of purchase possibility. The presence of 4-level specific links in TDB file (E-shop webpage URL) indicates a different level of customer readiness to purchase. The main home webpage of an e-shop may indicate just customer curiosity, while the use of links to detailed item descriptions shows a stronger desire to analyze and compare product features or prices among different suppliers. Adding items to the shopping basket does not necessarily indicate a purchase, as about 20% of basket items are abandoned without payment, but this action main mean more serious intention to buy than home page visit. The most valuable customers are those who frequently visit the e-shop, make purchases, and have a high total purchase value. The Specific Item ID link is connected to the second file--Product DB (PDB), which contains detailed information about the products, such as product name, price, current discount, etc. By analyzing the product-related data, the proposed strategy can recommend personalized advertising scenarios that are tailored to each customer's preferences and needs. Our methodology fundamentally revolves around displaying advertisements exclusively to the most valuable customers. The value of the customer is assumed to increase if their spending value at the e-shop increases. The proposed link-based customer's value indicator can be expressed by assigning different weights to the visited links. The total indicator characterizing the dynamics of customer engagement in e-shop surfing is defined as the cumulative value or the Customer Merit (CM) index. The CM index is the total weighted sum of the visited links, where the weights of possible links are denoted as w1, w2, w3, and w4, accordingly to 4 possible types of webpages. The CM index takes into account all types of adjustments and parameter settings, such as defining minimum time spent on the webpage to ensure that the customer's awareness of the presented information is sufficient. Only the customers with a sufficient value of the index CM can be assigned to the advertising campaign for showing ads to them. Additionally, the CM calculation takes into account the recency of the visits, as the more recent visits are considered to be stronger indicators of customer engagement than the elder ones. The algorithm also considers the frequency of visits to the e-shop, as frequent visits indicate a higher level of interest and engagement. The CM index calculation is performed dynamically, taking into account the customer's activity level, expediency in choosing items, and time spent exploring them. The algorithm also considers the customer's behavior across different types of links to determine their level of engagement and interest. The dynamic cumulative CM index value for each customer is registered in a third file--Customer DB (CDB). It enables to track customer value in real time and select candidates for a personalized advertising campaign. The visual example of calculating CM index for a selected customer is shown in Figure 3, where we can observe an illustrative example of a customer's sequence of actions at the e-shop site. The session starts with the customer visiting the webpage showing a group of items, then it follows by clicking on a specific product item and transferring it to the basket. The customer then proceeds to preview another product before making a purchase of a specific item.