Skip to content

feat(analytics): GA4 tracking for presets.polymaker.com downloads - #57

Merged
DerTeam-Polymaker merged 1 commit into
mainfrom
feature/GA
Jun 17, 2026
Merged

feat(analytics): GA4 tracking for presets.polymaker.com downloads#57
DerTeam-Polymaker merged 1 commit into
mainfrom
feature/GA

Conversation

@DerTeam-Polymaker

@DerTeam-Polymaker DerTeam-Polymaker commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add GA4 base tag (gtag.js) to index.html with Measurement ID G-KXL1MCXGJZ
  • Instrument download flows in app.js with four custom events fired on successful download
  • Enable debug_mode on localhost / 127.0.0.1 only to support local DebugView validation
  • Scope is limited to the presets.polymaker.com download page (index.html + app.js)

Events

Event Trigger
download_single Single JSON download succeeds (non-Bambu direct + Bambu JSON zip)
download_bundle Single .bbsflmt download succeeds
download_selected Multi-select ZIP download succeeds
download_bundle_batch Multi-material bundle ZIP download succeeds

Event parameters

  • Common: file_type, slicer, material, brand, model
  • Batch: selected_count, series, material_count
  • Missing values fallback to unknown; no PII is sent

Local validation (completed)

Verified in GA4 DebugView on localhost:

  • page_view
  • download_single
  • download_bundle
  • download_selected
  • download_bundle_batch

Post-deploy checklist

  • Deploy to https://presets.polymaker.com
  • Verify events in GA4 Realtime within 30 minutes
  • Mark the four download events as Key events in GA4 Admin
  • Confirm yellow "Data collection isn't active" warning clears after traffic arrives (24–48h)

Test plan

  • Open production site and confirm page_view in Realtime
  • Trigger one download per event type and confirm event names + parameters
  • Confirm download behavior is unchanged (files still download correctly)
  • Confirm non-Bambu JSON download still works after switching to fetch-based download for tracking

Integrate GA4 (G-KXL1MCXGJZ) on presets.polymaker.com to measure preset
download effectiveness. Add gtag.js page_view collection and fire custom
events after successful downloads: download_single, download_bundle,
download_selected, and download_bundle_batch. Enable debug_mode on
localhost only for local DebugView validation.
@DerTeam-Polymaker
DerTeam-Polymaker merged commit 3a720ef into main Jun 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant