# Goal function question

**URL:** <https://community.piwik.pro/t/goal-function-question/1808>\
**Category:** Data collection and tags\
**Created:** [March 14, 2023, 10:42am UTC](https://community.piwik.pro/t/goal-function-question/1808 "2023-03-14T10:42:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![austinwu-fiftyfive](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/austinwu-fiftyfive/32/1428_2.png) [@austinwu-fiftyfive](https://community.piwik.pro/u/austinwu-fiftyfive)\
**Post date:** [March 14, 2023, 10:42am UTC](https://community.piwik.pro/t/goal-function-question/1808/1 "2023-03-14T10:42:28Z")

</div>

I would like to know how to use “Track goal manually” in the goal function in Piwik Pro?

Also, Google Analytics has duration and page/session type of goal. How can I achieve the same effect in Piwik Pro?

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [March 14, 2023, 10:47am UTC](https://community.piwik.pro/t/goal-function-question/1808/2 "2023-03-14T10:47:10Z")

</div>

Hi. In this case you can use Tag Manager to trigger a conversion: [Goal conversion tag | Piwik PRO help center](https://help.piwik.pro/support/tag-manager/piwik-pro-goal-conversion/)

When it comes to the second question, it can be also controlled via tag manager triggers.

---

<div class="post-metadata">

**Author:** ![austinwu-fiftyfive](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/austinwu-fiftyfive/32/1428_2.png) [@austinwu-fiftyfive](https://community.piwik.pro/u/austinwu-fiftyfive)\
**Post date:** [March 14, 2023, 10:52am UTC](https://community.piwik.pro/t/goal-function-question/1808/3 "2023-03-14T10:52:51Z")

</div>

Thanks for your input. Can you specify how to do this via tag manager triggers?

For example, I would like to set page/session \> 5 as a goal. How am I going to do this?

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [March 14, 2023, 11:14am UTC](https://community.piwik.pro/t/goal-function-question/1808/4 "2023-03-14T11:14:19Z")

</div>

Ah, thanks for providing more details. This use case cannot be addressed in a simple way for now.

1. To do it only via tag manager, you would have to set up tag that triggers on page view, that would store the information in local storage or cookie for the duration of sessions. This tag would simply increase the counter on each page view. Then this value could be stored in tag manager variable to be able to use it while setting up other triggers.
2. In the near future we will be adding CDP Audience triggers to our tag manager which will address that use case in a much simpler way.

---

<div class="post-metadata">

**Author:** ![austinwu-fiftyfive](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/austinwu-fiftyfive/32/1428_2.png) [@austinwu-fiftyfive](https://community.piwik.pro/u/austinwu-fiftyfive)\
**Post date:** [March 14, 2023, 3:38pm UTC](https://community.piwik.pro/t/goal-function-question/1808/5 "2023-03-14T15:38:40Z")

</div>

> [@kuba](#):
>
> In the near future we will be adding CDP Audience triggers to our tag manager which will address that use case in a much simpler way.

Thanks for answering this.

May I know if I also need to wait for the future launch to align with goal type “duration” in GA?

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [March 14, 2023, 6:22pm UTC](https://community.piwik.pro/t/goal-function-question/1808/6 "2023-03-14T18:22:21Z")

</div>

Do you mean goals triggered after a certain amount of time spent on a specific page?
