Mouseflow Help & Support

Google Analytics Integration

Follow
1. Login to Universal Analytics and create a custom dimension (https://support.google.com/analytics/answer/2709829). The name should be "MFSID", the scope should be "User", and the "Active" box should be checked. On the right of the page (in the "Example" section), there will be code that looks like "ga('set', 'dimensionX', dimensionValue)". You'll want to take note of the dimension name that is listed ("dimensionX" in this example) for the next step.
 
2. On the website, you'll want to have the Mouseflow the tracking code installed and then add the following snippet below it (be sure to customize the code with your Universal Analytics Property ID which is found under "Admin" > "Property Settings" and the correct dimension name from step #1):
setTimeout(function() {
  if (typeof ga != 'undefined' && typeof mouseflow != 'undefined') {
     ga('create', 'UA-XXXXXXX');
     ga('set', 'dimensionX', mouseflow.getSessionId());
     ga('send', 'event', 'Mouseflow', mouseflow.getSessionId(), {'nonInteraction': 1});
  }
}, 5000);
3. In Universal Analytics, you'll navigate to Behavior > Events > Pages, click Secondary Dimension (dropdown) and pick the custom dimension you just setup.
 
4. This will display a custom report which shows a list of visitor data, including the Mouseflow Session ID tied to their activity. Then copy or export the resulting list of session IDs, login to Mouseflow, click "Recordings", click "Filter" (small funnel icon in top-right), and under "Filters", select "Session IDs" paste the list of session IDs you just copied/exported (one per line). Finally, click "Search" to see the filtered list of recordings.
 
Note: There is a delay of up to 24 hours before custom dimension data will appear in Google Analytics.


Tags: integrate google analytics use google analytics

Have more questions? Submit a request

Comments

  • Avatar
    darlene alu

    Where do we paste this code??

  • Avatar
    Mary Pretzer

    $(window).load(function() {
    _gaq.setCustomVar("MFSID", mouseflow.getSessionId());
    });

  • Avatar
    Mary Pretzer

    where do I paste this code?

  • Avatar
    Trenton Scott

    Hi Mary,

    My apologies! We just updated with the latest integration details. Please see https://mouseflow.zendesk.com/hc/en-us/articles/206505595.

    Regards,

    Trent

  • Avatar
    gavin

    Are there any issues with making this a session scoped dimension in google analytics instead?

  • Avatar
    Morten Hornbaek

    Hi Gavin - sounds like you're absolutely right about this. I'll do some testing and update this article if needed.

  • Avatar
    iarino

    How would it work if doing the integration via Google Tag Manager? Should we do another tag firing in "All pages" to insert de dimension code?

  • Avatar
    Morten Hornbaek

    Hi there,
    Yes, in this case you would want to add this as a custom tag. You would also need to make sure this tag is loaded after the Mouseflow and GA tags, respectively.

  • Avatar
    gavin

    Hi - any update about whether using a session scoped dimension in GA can be used instead of the User Scoped Dimension? What issues would we run into if we used the session scoped dimension instead?

  • Avatar
    Morten Hornbaek

    Hi Gavin,
    There shouldn't be any problems using a session scoped dimension instead of a user scoped dimension. So if you'd prefer the session metrics instead, you are free to do that.

    Edited by Morten Hornbaek
Powered by Zendesk