# GTM and Piwik PRO anonymous tracking?

**URL:** <https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518>\
**Category:** Data collection and tags\
**Created:** [March 11, 2022, 5:24pm UTC](https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518 "2022-03-11T17:24:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joao\_valente](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao_valente/32/284_2.png) [@joao\_valente](https://community.piwik.pro/u/joao_valente)\
**Post date:** [March 11, 2022, 5:24pm UTC](https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518/1 "2022-03-11T17:24:33Z")

</div>

Hello, is it possible to achieve [this setup](https://community.piwik.pro/t/how-to-integrate-3rd-party-consent-tool-with-piwik-pro-anonymous-tracking/128) with other TMS instead of PPTM? Namely GTM? Thanks

---

<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 15, 2022, 3:49pm UTC](https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518/2 "2022-03-15T15:49:47Z")

</div>

Hi. Could you describe your setup? Piwik PRO TM and GTM are quite similar tools, so most likely yes. You can load Piwik PRO container as one of the tags in GTM (with trigger set to all page views).

You can also [make the user anonymous](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html#setUserIsAnonymous) while using only the analytics tracking API, but this setup is not recommended. Sometimes it makes sense if, for some reason, you don’t want to use Piwik PRO Tag Manager.

---

<div class="post-metadata">

**Author:** ![joao\_valente](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao_valente/32/284_2.png) [@joao\_valente](https://community.piwik.pro/u/joao_valente)\
**Post date:** [March 15, 2022, 4:15pm UTC](https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518/3 "2022-03-15T16:15:47Z")

</div>

Hello Kuba,

We are using One Trust as our cookie CMP. We are still not ready to commit to use PPTM as our TMS, specially because of its lack of a feature where I can refer to other variables in HTML Tags and Custom Javascript Variables. This makes the switching setup harder.

Also regarding tracking, I am using HTML Tags instead of your GTM Template.  
How could I use the tracking API? Thanks

---

<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 16, 2022, 9:46am UTC](https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518/4 "2022-03-16T09:46:16Z")

</div>

Ok, so here is my point of view:

- set up PPTM (our installation snippet) via a custom code tag in GTM with trigger set to all page views
- then follow [this guide](https://community.piwik.pro/t/how-to-integrate-3rd-party-consent-tool-with-piwik-pro-anonymous-tracking/128)

You’ll have to check onetrust’s api to identify the event when consent was given, but other than that, it should be quite simple.

---

<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:** [October 18, 2022, 12:36pm UTC](https://community.piwik.pro/t/gtm-and-piwik-pro-anonymous-tracking/518/5 "2022-10-18T12:36:09Z")

</div>

2 posts were split to a new topic: [Use anonymous tracking without Tag Manager and Consent Manager](https://community.piwik.pro/t/use-anonymous-tracking-without-tag-manager-and-consent-manager/1144)
