Skip to main content

Analytics and Reporting

Scottsdale Mint uses several systems for tracking site performance, sales analytics, and customer behavior.


Systems Overviewโ€‹

ToolPurpose
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 RelicApplication performance monitoring (APM), Lambda error tracking
MetorikAdvanced WooCommerce sales analytics and reporting
WooCommerce AnalyticsBuilt-in WooCommerce reporting dashboard
Daily Precious Metals ReportCustom 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 placed
  • add_to_cart โ€” WooCommerce product added to cart
  • view_item โ€” WooCommerce product page viewed
  • begin_checkout โ€” checkout page loaded
  • search โ€” customer searches via Algolia
  • login, 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 VariableDescription
NEW_RELIC_APP_NAMEApplication name in New Relic (Scottsdale Mint Production)
NEW_RELIC_LICENSE_KEYNew 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:

MetalOunces Sold (Yesterday)RevenueOrder Count
GoldX oz$XX
SilverX oz$XX
PlatinumX oz$XX
PalladiumX oz$XX

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โ€‹

IssueAction
GA4 purchase events missingCheck GTM trigger; verify WooCommerce thank-you page fires GTM Purchase trigger
New Relic not receiving dataVerify NEW_RELIC_LICENSE_KEY is set; New Relic PHP agent must be installed on Lambda layer
Daily report not sentCheck WordPress scheduled events (wp cron event list); check Mailgun delivery logs
Metorik data gapMetorik polls hourly; check WooCommerce REST API credentials in Metorik settings