feat: add Google Analytics tracking for tickets and thank-you page #171
+93
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement Google Analytics Tracking for Ticket Sales
📝 Summary
This PR integrates GA4 (Google Analytics 4) ecommerce tracking to measure the conversion funnel—from the initial intent of clicking "Buy" to the successful purchase confirmation on the thank-you page.
🚀 Key Changes
begin_checkoutevent to the "Get your ticket!" buttons in the TicketVariant component. This allows us to track which ticket types (Regular vs. VIP) users are interested in.purchaseevent. It extracts transaction details (Order ID, Product Name, Price, Currency, and Quantity) directly from the URL parameters provided by the checkout system.window.gtagto resolve linting errors and ensure type safety across the tracking implementation.📊 Analytics Events
begin_checkoutitem_name,price,currencypurchase/thank-youpagetransaction_id,value,currency,items(name, price, qty)🛠 Testing Instructions
begin_checkoutevent fires./thank-you?ec_order_id=TEST_123&ec_product=VIP&ec_price=512&ec_currency=PLN&ec_amount=1&ec_product_id=1&ec_product_uuid=1&ec_price_id=1purchaseevent appears in the GA4 Real-time dashboard with the correct values.