Custom Goals
In a custom goal you can write your own code to trigger a goal. This statement need to return true to trigger the goal.
Example
if(window.location.href.indexOf(‘checkout’) > -1) {
return true;
}
This would set the goal for any visitor going to the url containing ”checkout”.
Another example
$(”body”).on(”click”, ”#checkout_button”, function() {
if( parseInt($(”.cart .summeryTotal”).text()) > 500 ) {
return true;
}
});
This would track visitors that clicked the checkout button and had more than 500 (£/$/kr…) in the basket.