Analytics and Reporting
Scottsdale Mint uses several systems for tracking site performance, sales analytics, and customer behavior.
Systems Overviewโ
| Tool | Purpose |
|---|---|
| Google Analytics 4 (GA4) | Web traffic, customer behavior, conversion tracking |
| Google Tag Manager (GTM) | Tag management for GA4, Kount, Attentive, and other tracking scripts |
| New Relic | Application performance monitoring (APM), Lambda error tracking |
| Metorik | Advanced WooCommerce sales analytics and reporting |
| WooCommerce Analytics | Built-in WooCommerce reporting dashboard |
| Daily Precious Metals Report | Custom daily email report on ounces sold by metal |
Google Analytics 4โ
GA4 is implemented via Google Tag Manager to keep analytics code off the page directly and make it easy to update.
Key GA4 events tracked:
purchaseโ when a WooCommerce order is placedadd_to_cartโ WooCommerce product added to cartview_itemโ WooCommerce product page viewedbegin_checkoutโ checkout page loadedsearchโ customer searches via Algolialogin,sign_upโ account events
WooCommerce eCommerce tracking is implemented to send purchase data (order ID, revenue, items) to GA4.
Google Tag Managerโ
GTM manages deployment of the following third-party scripts:
- Google Analytics 4
- Google Ads remarketing
- Facebook Pixel
- Pinterest Tag
- Kount data collector
- Attentive SMS pop-up
- Yotpo review widget
Workspace: Tag management is done in the GTM portal โ no code changes needed to add/update standard tracking pixels.
New Relicโ
New Relic Application Performance Monitoring is integrated via the New Relic PHP agent and the wonolog logging integration.
What New Relic monitors:
- Lambda function execution time
- PHP error rate by endpoint
- Database query performance (Aurora MySQL)
- External API call latency (Algolia, Kount, PayPal, NFusion)
- Deployment tracking (via New Relic deployment markers)
Configuration:
| ENV Variable | Description |
|---|---|
NEW_RELIC_APP_NAME | Application name in New Relic (Scottsdale Mint Production) |
NEW_RELIC_LICENSE_KEY | New Relic ingest license key |
See Logging for more detail on New Relic + Wonolog integration.
Metorikโ
Metorik is a SaaS WooCommerce analytics tool that provides:
- Revenue, orders, and customer reports beyond WooCommerce's built-in analytics
- Customer cohort analysis (retention, churn)
- Product performance reports
- Coupon usage reports
- Automated "Engage" email campaigns triggered by data rules
- CSV exports
Metorik connects directly to the WooCommerce REST API โ no WordPress plugin required. Authentication uses WooCommerce Application Passwords.
WooCommerce Analytics Dashboardโ
The built-in WooCommerce Analytics dashboard (/wp-admin/admin.php?page=wc-admin) provides:
- Revenue, orders, average order value
- Product performance
- Category performance
- Customer reports
- Stock reports
This is the primary day-to-day reporting tool for the store operations team.
Daily Precious Metals Reportโ
A custom daily email report sends a summary of precious metals ounces sold to the management team.
Triggered by: A scheduled WordPress cron job (suma_daily_analytics_report) running at 8:00 AM MST.
Report contents:
| Metal | Ounces Sold (Yesterday) | Revenue | Order Count |
|---|---|---|---|
| Gold | X oz | $X | X |
| Silver | X oz | $X | X |
| Platinum | X oz | $X | X |
| Palladium | X oz | $X | X |
The report is generated by querying completed WooCommerce orders from the previous calendar day and summing _metal_weight_troy_oz ร quantity per metal type.
Report recipients: Configurable in the plugin settings (stored in WordPress options).
Implementation: Located in web/app/plugins/wc-admin-precious-metals-data/ โ see Precious Metals Data Plugin.
Troubleshootingโ
| Issue | Action |
|---|---|
| GA4 purchase events missing | Check GTM trigger; verify WooCommerce thank-you page fires GTM Purchase trigger |
| New Relic not receiving data | Verify NEW_RELIC_LICENSE_KEY is set; New Relic PHP agent must be installed on Lambda layer |
| Daily report not sent | Check WordPress scheduled events (wp cron event list); check Mailgun delivery logs |
| Metorik data gap | Metorik polls hourly; check WooCommerce REST API credentials in Metorik settings |