Analyze and optimize marketing campaign performance in real-time.
psql
, is installed in your environment. For detailed instructions, see Download PostgreSQL.marketing_events
table tracks user interactions with marketing campaigns and includes details, such as the number of clicks and impressions, of each event.
campaigns
table stores information about each marketing campaign, such as what type of campaign it was and the target audience.
ab_test_variants
contains details, such as the variant type and name, about A/B test variations for campaigns.
data_generator.py
file. This Python script utilizes the psycopg2
library to establish a connection with RisingWave so you can generate and insert synthetic data into the three tables described above.
If you are not running RisingWave locally or using default credentials, update the connection parameters accordingly:
campaign_performance
materialized view summarizes the performance metrics of the marketing campaigns over 1-hour time windows. The tumble
function is used to map each event into a 1-hour time window.
You will gain insight into key performance indicators for each campaign, such as the number of impressions, clicks, and conversions.
campaign_performance
to see the results.
channel_attribution
materialized view analyzes the marketing performance over 1-hour time windows. Again, the tumble
function is used to map each event into a 1-hour time window. Then, you group by the time window and channel type to find the aggregate channel metrics.
This materialized view helps to show the effectiveness of each marketing channel in driving conversion and revenue. It provides details such as the number of unique, engaged users, and the total revenue generated by each channel.
channel_attribution
to see the results.
ab_test_results
materialized view analyzes the results of the A/B test over 1-hour time windows. A multi-way join is used to retrieve campaign details and details on the test variations.
This materialized view allows you to evaluate the A/B test and determine which test variant performed best. From there, you can make more informed decisions on which marketing campaign to move forward with.
ab_test_results
to see the results.
Ctrl+C
to close the connection between RisingWave and psycopg2
.