shvetsihorr / SQL-Projects

SQL and Google BigQuery-Portfolio Projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL and Google BigQuery-Portfolio Projects

Welcome to my portfolio, where I showcase my expertise in SQL and Google BigQuery through various product/eCommerce and marketing analytics projects. These projects demonstrate my ability to analyze and optimize ad performance, track eCommerce funnel progression, and generate actionable insights from large datasets. From calculating campaign metrics to exploring conversion rates and user engagement, my work reflects a deep understanding of both marketing and product analytics.

Feel free to connect with me via: LinkedIn Ihor Shvets, Email: shvets.ihor@outlook.com

Tools Used:

  • PostgreSQL: For querying and analyzing data across various projects.
  • Google BigQuery: For managing and analyzing large datasets, especially in eCommerce and ad performance analysis.
  • Google Analytics 4 (GA4): For accessing eCommerce data in BigQuery.

Table of Contents

Projects:

Project 1: Daily Campaign Performance Metrics

This SQL query aggregates daily performance data for ad campaigns from the facebook_ads_basic_daily table. It calculates key metrics including total spend, impressions, clicks, and value, as well as Cost Per Click (CPC), Cost Per Thousand Impressions (CPM), Click-Through Rate (CTR), and Return on Marketing Investment (ROMI). Results are grouped by date and campaign ID, with metrics rounded to the nearest whole number or two decimal places as appropriate.

View SQL query

Daily Campaign Performance Metrics

Project 2: Combining Facebook and Google Ads Data

In this project, I used SQL to combine data from two tables, facebook_ads_basic_daily and google_ads_basic_daily, using a Common Table Expression (CTE). The query aggregates metrics for ad campaigns from both sources by date and media source. The key metrics include total spend, impressions, clicks, and conversion value. This approach provides a unified view of ad performance across platforms.

View SQL query

Combining Facebook and Google Ads Data

Project 3.1: Campaign Performance Analysis Across Facebook and Google Ads

In this project, I combined data from four tables, and using CTEs, I merged Facebook and Google Ads data to analyze campaign performance. The query calculated daily metrics like spend, impressions, clicks, and conversion value, grouped by date, media source, campaign, and ad set.

This analysis provided a unified view of ad performance across both platforms.

View SQL query

Campaign Performance Analysis Facebook and Google Ads

Project 3.2 Campaign ROMI Analysis with SQL

  • Identified the campaign with the highest ROMI (spend > 500,000).
  • Found the ad set with the highest ROMI within that campaign.

Summary: This project highlights my SQL skills in merging data, calculating marketing metrics, and analyzing ad performance.

View SQL query

Campaign ROMI Analysis with SQL

Project 4: Metrics Calculation and UTM Campaign Tracking with SQL

In this project, I used SQL to merge daily performance data from both Facebook and Google Ads into a unified dataset. I extracted key UTM campaign parameters and calculated essential advertising metrics such as CTR, CPC, CPM, and ROMI. The process involved handling null values, applying regular expressions to retrieve UTM parameters, and using CASE statements to avoid division errors. This project showcases my ability to work with large datasets, perform detailed campaign analysis, and generate actionable insights for marketing performance tracking.

View SQL query

UTM Campaign Tracking and Metrics Calculation

Project 4.2: Calculating Month-over-Month Differences for CPC, CPM, and ROMI by UTM Campaign

For this project, I built on a previous SQL task to analyze monthly ad performance. I used Common Table Expressions (CTEs) to group data by the first day of the ad month, aggregating metrics such as total spend, impressions, clicks, conversion value, CTR, CPC, CPM, and ROMI.

In this SQL query, I introduced a calculation to compare CPM, CTR, and ROMI performance month-over-month for each UTM campaign, expressed as a percentage change. This project demonstrates my ability to perform advanced data aggregation, time-based comparisons, and insights generation for marketing performance analysis.

View SQL query

Calculating Month-over-Month Differences for CPC, CPM, and ROMI by UTM Campaign

Project 5: Data Preparation for BI Reporting using Google BigQuery

In this project, I practiced writing SQL queries in BigQuery using the free Google Analytics 4 (GA4) dataset. My focus was on analyzing eCommerce funnel progression.

View Project on Google BigQuery if you have an account

View BigQuery SQL as download file

 Data Preparation for BI Reporting using Google BigQuery

Project 6: Conversion Calculation by Date and Traffic Channel using Google BigQuery

For this task, I created a query to calculate conversions from session start to purchase, segmented by date and traffic channel.

Note: The query considered both session and user IDs to ensure accurate counts of unique sessions by unique users, as different users might have the same session IDs.

This analysis provided insights into how conversions progress through different stages of the user journey, segmented by date and traffic channel.

View Project on Google BigQuery if you have an account

View BigQuery SQL as download file

Conversion Calculation by Date and Traffic Channel

Project 7. Comparison of Conversion Rates Between Different Landing Pages using Google BigQuery

For this task, I analyzed conversion rates across different landing pages. Objective: I created a query to extract the page_path from the page_location in session start events for the year 2020. For each unique landing page, I calculated:

  • The number of unique sessions by unique users.
  • The number of purchases.
  • The conversion rate from session start to purchase.

Note: Since session start and purchase events may have different URLs, I merged these events using user and session identifiers to ensure accurate conversion tracking.

This analysis provided insights into how different landing pages perform in terms of driving conversions.

View Project on Google BigQuery if you have an account

View BigQuery SQL as download file

Comparison of Conversion Rates Between Different Landing Pages

Project 8. Correlation Analysis Between User Engagement and Purchases using Google BigQuery

For this task, I assessed the correlation between user engagement and purchase behavior. I determined for each unique session:

  • Whether the user was engaged (if session_engaged parameter equals ‘1’).
  • The total engagement time during the session (sum of engagement_time_msec across events).
  • Whether a purchase occurred during the session.

I then calculated the correlation coefficients:

  • Between user engagement and purchase occurrence.
  • Between total engagement time and purchase occurrence.

I merged session start events with other session events using user and session identifiers to ensure accurate correlation analysis.

View Project on Google BigQuery if you have an account

View BigQuery SQL as download file

Correlation Analysis Between User Engagement and Purchases

Skills Demonstrated:

SQL Querying and Data Management

  • Data Aggregation: Expertise in aggregating daily and monthly performance metrics from ad campaign data, including spend, impressions, clicks, CTR, CPC, CPM, and ROMI.
  • Complex Joins and CTEs: Proficiency in using Common Table Expressions (CTEs) to combine and analyze data from multiple tables, such as combining Facebook and Google Ads data.
  • Advanced Calculations: Ability to perform advanced calculations for marketing metrics and analyze month-over-month differences for CPC, CPM, and ROMI.
  • Error Handling: Skilled in handling null values, applying regular expressions, and using CASE statements to avoid errors in calculations.

Google BigQuery

  • Large Dataset Management: Experience in managing and querying large datasets using Google BigQuery, particularly for eCommerce and ad performance analysis.
  • Conversion Funnel Analysis: Competence in analyzing eCommerce funnel progression and calculating conversions segmented by date and traffic channel.
  • Performance Tracking: Proficiency in tracking and comparing conversion rates across different landing pages, and conducting correlation analysis between user engagement and purchases.
  • Data Preparation and BI Reporting
  • Data Preparation: Ability to prepare and clean data for Business Intelligence (BI) reporting, ensuring accurate and actionable insights.
  • Correlation Analysis: Experience in performing correlation analysis to determine relationships between user engagement metrics and purchase behavior.

Analytical Skills

  • Insight Generation: Demonstrated ability to generate actionable insights from data to inform marketing strategies and improve campaign performance.
  • Detailed Reporting: Skilled in creating detailed reports and visualizations to convey complex data analysis effectively.

Contact

Feel free to connect with me via:

About

SQL and Google BigQuery-Portfolio Projects