Set up Google Analytics to track Fuse experiments

Set up Google Analytics to track Fuse experiments

This page describes how to set up Google Analytics to track engagement for fuse tag multivariate testing.

Each fuse configuration has a unique ID that can be set as a custom dimension in GA. The ID will be available to set in Google Analytics at window.fusetag.fuseUUID

Customer Setup

The steps for a publisher are:

  1. Setup Fuse UUID Custom Dimension in Google Analytics

  2. Update Google Analytics to record Fuse UUID

Setup Fuse UUID Custom Dimension

You need to set up a custom dimension in Google Analytics with scope ‘Hit’. Steps for setting up a custom dimension in Google Analytics can be found here: https://support.google.com/analytics/answer/2709829?hl=en

You then need to record:

  • Index of new custom dimension

  • Name of new custom dimension e.g. Fuse UUID

Update Google Analytics initialization to record Fuse UUID

We would like the Fuse UUID to be captured in all GA events. To ensure this happens, the new custom dimension value should be set when GA is initialized.

The Fuse UUID is only available after the fuse script has loaded, so GA setup should be done after the fuse script is loaded

  1. <script async src="fuse.js"></script>
  2. <script type="text/javascript">
  3.   var fusetag = window.fusetag || { que: [] };
  4.   fusetag.que.push(function() {
  5.     // Initialise GA Here with custom dimension
  6.     // Example for gtag
  7.     gtag('config', 'UA-XXXXX-Y'
  8.       'custom_map': { 'dimension1': 'fuse_uuid' },
  9.       'fuse_uuid': fusetag.fuseUUID
  10.     );
  11.   });
  12. </script>

 

GA4

The setup for GA4 is shown below

  1. <script async src="fuse.js"></script>
  2. <!-- Google tag (gtag.js) -->
  3. <script async src="https://www.googletagmanager.com/gtag/js?id=G-ZZZZZ"></script>
  4. <script>
  5.   var fusetag = window.fusetag || { que: [] };
  6.   window.dataLayer = window.dataLayer || [];
  7.   function gtag(){
  8.     dataLayer.push(arguments);
  9.   }
  10.   
  11.   fusetag.que.push(function() {
  12.     // Initialise GA Here with custom dimension
  13.     gtag('js', new Date());

  14.     // Set UUID custom dimension on config
  15.     gtag('config', 'G-ZZZZZ', { 'fuse_uuid': fusetag.fuseUUID });
  16. </script>


Google Tag Manager

Configuration of Google Tag manager to set the fuse UUID on start up can be done below. Here the index of the custom dimension is 1.

  1. gtag('config', 'UA-XXXXX-Y'
  2.       'custom_map': { 'dimension1': 'fuse_uuid' },
  3.       'fuse_uuid': fusetag.fuseUUID
  4.     );

 

Google Analytics (analytics.js)

The fuse UUID can be set in custom dimension index 1 as:

  1. ga('set', 'dimension1', fusetag.fuseUUID);

 

Google Analytics (ga.js)

The fuse UUID can be set in custom dimension index 1 as:

  1. window._gaq.push([’_setCustomVar', 
  2.   1, // custom dimension index
  3.   'fuse_uuid',
  4.   window.fusetag.fuseUUID
  5. ]);

    • Related Articles

    • Google Analytics in Publift's Dashboard - Q&A

      Welcome to the Google Analytics Q&A! All the common questions that have been asked about GA in the dashboard are below. If you have further questions, feel free to comment on this article and our team will answer your question!  Q. What is the Page ...
    • Publift Fuse - New Dashboard Explained - Metrics and FAQ

      Publift is moving into a New Dashboard. In this article, you will be able to see the updated metrics and the reasons for the change. Understand how the Dashboard works by clicking on this link: Dashboard How-to Video The metrics we report will change ...
    • How do I set up ad refresh on my site?

      Refresh can be set at both an account level, and at an ad unit level. If you would like to change or set a custom refresh time for your account or a particular unit, reach out to our friendly Account Management team. If you're interested in how the ...
    • I have just gone live with Fuse tags, but my CPM is lower than expected? Why?

      Many factors determine your CPM. This article will help you understand what to expect Whilst this is not an ideal situation for any publisher,  this can happen. Swapping to our Fuse tags can see a drop in CPM from your existing setup eg Adsense.   ...
    • How to Implement a Consent Listener for Non-IAB Vendors

      Each vendor that you have implemented on your page, such as Facebook or Google Analytics, would need to have the nonIABVendorConsent API implemented to gather user consent to comply with GDPR by implementing the script below to your page, at the same ...