Mouseflow Help & Support

Eloqua Integration

Follow

With Mouseflow, it's easy to integrate with other tools like Eloqua. To save the Eloqua session ID into Mouseflow (for sorting/filtering based on this value), you can extract the data from the user's cookies and send it to Mouseflow.

This integration makes use of some extra JavaScript. Just replace your tracking code with the snippet below.

Example:

<script type="text/javascript">

        var Cookie = {
	   set: function(name, value, days)
	   {
	      var domain, domainParts, date, expires, host;

	      if (days)
	      {
	         date = new Date();
	         date.setTime(date.getTime()+(days*24*60*60*1000));
	         expires = "; expires="+date.toGMTString();
	      }
	      else
	      {
	         expires = "";
	      }

	      host = location.host;
	      if (host.split('.').length === 1)
	      {
	         document.cookie = name+"="+value+expires+"; path=/";
	      }
	      else
	      {
	         domainParts = host.split('.');
	         domainParts.shift();
	         domain = '.'+domainParts.join('.');

	         document.cookie = name+"="+value+expires+"; path=/; domain="+domain;

	         if (Cookie.get(name) == null || Cookie.get(name) != value)
	         {
	            domain = '.'+host;
	            document.cookie = name+"="+value+expires+"; path=/; domain="+domain;
	         }
	      }
	   },

	   get: function(name)
	   {
	      var nameEQ = name + "=";
	      var ca = document.cookie.split(';');
	      for (var i=0; i < ca.length; i++)
	      {
	         var c = ca[i];
	         while (c.charAt(0)==' ')
	         {
	            c = c.substring(1,c.length);
	         }

	         if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	      }
	      return null;
	   },

	   erase: function(name)
	   {
	      Cookie.set(name, '', -1);
	   }
	};


// mouseflow tracking code

window._mfq = window._mfq || [];
 (function() {
 var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true;
 mf.src = "//cdn.mouseflow.com/projects/your-website-id.js";
 document.getElementsByTagName("head")[0].appendChild(mf);
 })();

 // eloqua integration code

if (Cookie.get('ELOQUA')) {
 _mfq.push(["setVariable", "eloqua_id", Cookie.get('ELOQUA')]);
}
</script>

 

Tags: eloqua

Have more questions? Submit a request

Comments

Powered by Zendesk