Google Analytics for Facet Pages

With Google Analytics, it’s very easy to track how users are interacting with facets.

First, make sure your site is using the new GA embed (notice the ga() function):


  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', 'UA-XXXXXXXX-X', 'auto'); // enter your account ID
  ga('send', 'pageview');


Next, we use the ga() function within the facetwp-loaded event to trigger a pageview.

(function($) {
    $(document).on('facetwp-loaded', function() {
        if (FWP.loaded) {
            ga('send', 'pageview', window.location.pathname +;

That’s it! Both snippets can go into your theme’s header.php (or into a custom javascript file).