Go Back

Setting Goals Manually

January 23, 2018

You can set Goals manually when in-built conditions do not meet your business needs. For example:

  • When a user has stayed more than a given amount of time on the page
  • When a user visits more than 10 unique pages on your website
  • To trigger a goal conversion, use this script:

    // logs a conversion for goal 1
    _paq.push(['trackGoal', 1]);

    You can also register a conversion for this goal with a custom revenue. For example, you can generate the call to trackGoal() dynamically to set the revenue of the transaction:

    // logs a conversion for goal 1 with the custom revenue set
    _paq.push(['trackGoal', 1, <?php echo $cart->getCartValue(); ?>]);

    It is highly recommended to implement manual goals with Piwik PRO Tag Manager for smooth and easy experience that doesn’t involve IT department.

    Learn how to implement goal conversion tracking with Piwik PRO Tag Manager.