Skip to main contentAxo Analytics works great with Ember.js, a robust framework for building ambitious web applications. As Ember.js is a Single Page Application (SPA) framework, proper configuration ensures accurate tracking of dynamic route changes without full page reloads.
Steps to Integrate
- Add the Axo embed code to the HTML file that renders your Ember app (typically
index.html in the root of your project). Paste the script tag (from your site’s Install section) into the <head> section.
- Go to the menu on the top right
≡ and navigate to Settings
- Click
Sites.
- Select the site you wish to integrate.
- Set the
SPA Mode to auto for automatic detection and handling of navigation events. This is recommended for most Ember apps as it covers both history and hash routing intelligently.
Being Explicit
If your Ember app exclusively uses the HTML5 History API (default in modern Ember) or hash-based routing, you can fine-tune the SPA mode for precision:
history: Tracks changes via the browser’s History API (e.g., pushState and replaceState), ideal for clean URL paths.
hash: Listens to hashchange events, suitable for apps using URL fragments (e.g., #/route).
Update this in the site settings and save. For custom event tracking (e.g., on route transitions), use the Client-Side API like window.axoanalytics.trackPageview(). Test by navigating your app and checking real-time data in the dashboard. If issues arise, ensure no ad blockers interfere.