Conversion and goal tracking

Marfeel allows you track goals or conversions like subscribing to a newsletter, signing up to the site, playing a video or subscribing to a paywall.

To track a conversion invoke the trackConversion method:

window.marfeel.cmd.push(['compass', function(compass) {
	compass.trackConversion('subscribe');
}]);

You can track different conversions providing different conversion names.

window.marfeel.cmd.push(['compass', function(compass) {
	compass.trackConversion('Newsletter elecciones');
}]);

Automatic conversion tracking

Marfeel can automatically track conversions when

  • A user clicks on a <button> or <a > element
  • A user submits a <form>
  • For button and a elements, Compass will register a conversion when a click is triggered.
  • For form element, Compass will register a conversion when a submit is triggered.

To do so add the attribute data-mrf-conversion="nameOfTheConversion" to the element you want Marfeel to track. Example:

<form data-mrf-conversion="newsletterSubscription">
	<input type="submit" value="Submit" />
</form>

<a href="/last-news" data-mrf-conversion="lastNews-header" />

<button class="btn btn-big icon–like" data-mrf-conversion="likeButton" />