Marfeel allows tracking goals and conversions like subscribing to a newsletter, signing up to the site, playing a video or subscribing to a paywall. When you track a conversion Marfeel automatically infers the context and calculates different attribution models.
Subscriptions
To track a new subscription invoke the trackConversion
method:
window.marfeel = window.marfeel || { cmd: [] };
window.marfeel.cmd.push(['compass', function(compass) {
compass.trackConversion('subscribe');
}]);
Registrations & generic goal tracking
You can track different conversions providing different conversion names.
window.marfeel.cmd.push(['compass', function(compass) {
compass.trackConversion('Newsletter Elections');
}]);
window.marfeel.cmd.push(['compass', function(compass) {
compass.trackConversion('signup');
}]);
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
anda
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" />