Mouseflow Help & Support

Installing Mouseflow Using Tag Managers


With Mouseflow, you can either install the tracking code directly to your site or add it to a tag manager. This article explains how to implement the tracking code in various tag managers.

Google Tag Manager (v2)

To install Mouseflow using Google Tag Manager (v2), follow the steps below:

  1. Log in to Google Tag Manager or create an account if you don't have one already.
  2. Select a Container you want to deploy the tag to.
  3. Select "Tags" > "New" and mouse over the "Tag Configuration" section to click the pencil (edit) icon in the upper-right. This will open the "Choose tag type" window where, under "More", you'll want to select "Mouseflow".
  4. In the top of window, change the tag title from "Untitled tag" to "Mouseflow" (or another alias of your choosing).
  5. In your Mouseflow account, select a website and then click "Settings". In the left-hand side, copy the Website ID and paste it (including the dashes) in the Project ID field in Google Tag Manager.
  6. In the "Triggering" section, click the pencil (edit) icon in the upper-right and either (a) apply one of your existing firing rules which will execute the code on all pages or (b) create a new one by clicking the plus (+) icon in the upper-right, change the rule title from "Untitled trigger" to "All pages", mouse over the "Trigger Configuration" section to click the pencil (edit) icon in the upper-right which will open the "Choose trigger type" window where, under "Page View", you'll want to select "Page View" and then click "Save". You may also want to set a Tag Firing Priority for this tag (e.g. 1) so that it fires after Universal Analytics/Google Analytics (e.g. 2) and Mouseflow (e.g. 3).
  7. When finished, click "Save" and then test/publish the changes.


To install Mouseflow using Tealium, follow the steps below:

  1. Log in to your Tealium account or create an account if you don't have one already.
  2. Search for the Mouseflow tag in the Tealium iQ tag marketplace.
  3. Configure the Mouseflow tag with client-specific credentials. We recommend using the following:
    1. Use mapping to override the default Account ID.
    2. Use mapping to push key/value pairs into the _mfq array. Replace "myvar" with your variable name to use this feature.
  4. Assign page load rules. By default, the tag is set to fire on all pages. You can set conditional options so tags are only fired on specific pages.
  5. Data mapping: Choose the data sources that are looking to be collected from the tag. You should have Account ID (account) and Custom Parameter (myvar) listed.
  6. Click "Apply" and you should be all set.
  7. We recommend that you test the different Enterprise Capabilities. You can manage user permissions and test out profiles in different environments (Dev, QA, Prod). Marketing or eCommerce can add tags and have them approved by IT, thus improving workflow and decreasing implementation cycles.

  8. We also recommend you explore Tealium's Extensions. They offer added functionality and allow for easier and more advanced tag-based implementations.


To install Mouseflow using Segment, follow the steps below:

  1. Log in to your Segment account or create an account if you don't have one already.
  2. Choose or create the project you would like to connect Mouseflow to. Go to the Integrations tab and click the Mouseflow tab.
  3. Paste your unique Mouseflow website ID in the "Site ID" section. Your website ID is located in your Mouseflow account in the website's dashboard > Click the "Settings" tab on the left hand side > Copy the website ID. Under "Advanced Settings" you can also set an HTML delay. Read more about that feature here.
  4. Click "Save and Close" and flip Mouseflow "On". You're all set.
  5. You can also read more about integrating with Segment on Segment's help page.


Tags: google tag manager tealium segment tag manager

Have more questions? Submit a request


  • Avatar

    Hi. I'm wondering how I can send the Mouseflow session ID to Google Analytics via Tag Manager? I read the Google Analytics integration article but it didn't cover Tag Manager.

  • Avatar
    Evan Hill

    Hi Mitchell,

    You can deploy the GA integration code via a separate Custom HTML/JS snippet in Google Tag Manager. You'll need to run two code snippets: one for Mouseflow (the template) and one for the integration (custom HTML/JS).

  • Avatar

    Right now I have the pre-configured Mouseflow tag. Then a custom HTML tag that I copied the snippet into...

    setTimeout(function() {
    if (typeof ga != 'undefined' && typeof mouseflow != 'undefined') {
    ga('create', 'UA-XXXXXXXX');
    ga('set', 'dimension1', mouseflow.getSessionId());
    ga('send', 'event', 'Mouseflow', mouseflow.getSessionId(), {'nonInteraction': 1});
    }, 5000);

    This works but I get an error with the Tag Assistant (Chrome plugin) saying the GA account is called outside of the body. Is there a better way to configure the custom tag?

  • Avatar
    Evan Hill

    Hi Mitchell,

    This is the best way to do it and it shouldn't be causing any issues. Can you please double check?


  • Avatar
    Evan Hill

    Specifically, can you confirm whether data is now flowing into Google Analytics?

Powered by Zendesk