Initial Contact Attribution
HardUnlock detailed company stats for this questionUpgrade
You are given the following two tables:
attribution table:
session_id(string): The unique identifier for a user session.marketing_channel(string): The marketing channel that led to the session.purchase_value(float): The monetary value of purchases made during the session.
user_sessions table:
session_id(string): The unique identifier for a user session (linked toattributiontable).ad_click_timestamp(datetime): The timestamp when the user clicked on an ad, indicating their entry into the session.user_id(string): The unique identifier for the user associated with the session.
Determine the percentage of high-value customers attributed to each marketing channel based on their initial point of contact. A high-value customer is defined as a user whose total purchase value (across all sessions) exceeds 100. The initial point of contact is the user's first recorded session, based on the ad_click_timestamp.
Your output should include the following columns:
marketing_channel(string): The marketing channel associated with the user's first session.perc_high_value(float): The percentage of high-value customers that originated from each marketing channel, relative to the total number of high-value customers.
Example output: