Setting up and tracking goals for e-commerce transactions and revenue in Google Analytics involves enabling Enhanced E-commerce, configuring tracking codes, and setting up goals to capture key metrics. Here’s a comprehensive guide to help you through the process:
Step 1: Enable Enhanced E-commerce
- Access Google Analytics:
- Log in to your Google Analytics account and navigate to the property where you want to set up e-commerce tracking.
- Navigate to the Admin Panel:
- Click on the “Admin” button at the bottom left corner of the interface.
- Enable Enhanced E-commerce:
- Under the “View” column, click on “E-commerce Settings.”
- Toggle the “Enable E-commerce” and “Enable Enhanced E-commerce Reporting” switches to ON.
- Click “Next Step” and then “Submit.”
Step 2: Implement E-commerce Tracking Code
- Google Tag Manager (GTM):
- If you use Google Tag Manager, set up e-commerce tracking tags.
- Create a new tag in GTM and choose “Google Analytics: Universal Analytics.”
- Select “Track Type” as “Transaction” and configure the tag to fire on the purchase confirmation page.
- Direct Implementation:
- If you don’t use GTM, you need to add the tracking code directly to your website.
- Use the gtag.js library to implement e-commerce tracking. The tracking code needs to be added to your purchase confirmation page.
Here’s a sample implementation using gtag.js:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXX-Y"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXX-Y');
gtag('event', 'purchase', {
"transaction_id": "24.031608523954162",
"affiliation": "Online Store",
"value": 23.07,
"currency": "USD",
"tax": 1.24,
"shipping": 0,
"items": [
{
"id": "P12345",
"name": "Android Warhol T-Shirt",
"list_name": "Search Results",
"brand": "Google",
"category": "Apparel/T-Shirts",
"variant": "Black",
"list_position": 1,
"quantity": 2,
"price": '2.0'
},
{
"id": "P67890",
"name": "Flame challenge TShirt",
"list_name": "Search Results",
"brand": "MyBrand",
"category": "Apparel/T-Shirts",
"variant": "Red",
"list_position": 2,
"quantity": 1,
"price": '3.0'
}
]
});
</script>
Step 3: Verify E-commerce Tracking
- Real-Time Reporting:
- In Google Analytics, go to “Real-Time” > “E-commerce” to verify that transactions are being recorded.
- Purchase Testing:
- Complete a test purchase on your website to ensure that the data is being tracked correctly.
Step 4: Set Up E-commerce Goals
- Navigate to Admin Panel:
- In Google Analytics, go to the Admin panel and select the view where you want to create goals.
- Create New Goal:
- Click on “Goals” under the View column.
- Click on “+ New Goal” to create a new goal.
- Goal Setup:
- Goal Setup: Choose “Custom” and click “Continue.”
- Goal Description: Name your goal (e.g., Purchase Completed).
- Goal Type: Select “Destination” and click “Continue.”
- Goal Details:
- Destination: Set the goal destination as the URL of your purchase confirmation page (e.g.,
/thank-you
). - Value: Optionally, set the goal value. However, since e-commerce tracking already captures transaction values, this might not be necessary.
- Funnel (Optional): Define the funnel steps leading to the purchase confirmation page if you want to track where users drop off during the purchase process.
- Destination: Set the goal destination as the URL of your purchase confirmation page (e.g.,
- Save the Goal:
- Click “Save” to create your goal.
Step 5: Analyze E-commerce Data
- E-commerce Overview:
- Navigate to “Conversions” > “E-commerce” > “Overview” to see an overview of your e-commerce performance, including revenue, transactions, and conversion rate.
- Product Performance:
- Go to “Conversions” > “E-commerce” > “Product Performance” to analyze which products are performing well, including details like quantity sold and revenue generated.
- Sales Performance:
- Navigate to “Conversions” > “E-commerce” > “Sales Performance” to see detailed sales metrics, including total revenue, tax, shipping, and refunds.
- Shopping Behavior Analysis:
- Under “Conversions” > “E-commerce” > “Shopping Behavior,” you can analyze user behavior through different stages of the shopping process, from product views to transactions.
- Checkout Behavior Analysis:
- Go to “Conversions” > “E-commerce” > “Checkout Behavior” to analyze user behavior during the checkout process and identify drop-off points.
Step 6: Monitor and Optimize
- Custom Reports:
- Create custom reports to focus on specific aspects of your e-commerce performance. Go to “Customization” > “Custom Reports” > “+ New Custom Report.”
- Dashboards:
- Set up dashboards to monitor key e-commerce metrics at a glance. Navigate to “Customization” > “Dashboards” > “+ New Dashboard.”
- Segmentation:
- Use segments to analyze e-commerce performance for different user groups, such as new vs. returning customers or traffic sources.
- Conversion Rate Optimization (CRO):
- Use insights from your e-commerce reports to optimize your website for higher conversion rates. Conduct A/B testing on product pages, checkout processes, and promotional offers.
Conclusion
By following these steps, you can effectively set up and track goals for e-commerce transactions and revenue in Google Analytics. This comprehensive tracking will provide valuable insights into your online store’s performance, helping you make data-driven decisions to improve your e-commerce business. Regular monitoring and analysis will enable you to identify trends, optimize your marketing strategies, and enhance the overall shopping experience for your customers.