# Double tracking Piwik Pro

**URL:** <https://community.piwik.pro/t/double-tracking-piwik-pro/2818>\
**Category:** Data collection and tags\
**Created:** [August 31, 2023, 8:47am UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818 "2023-08-31T08:47:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![romainproximity](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@romainproximity](https://community.piwik.pro/u/romainproximity)\
**Post date:** [August 31, 2023, 8:47am UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818/1 "2023-08-31T08:47:07Z")

</div>

Hello the community, I would like to get a double tracking on my website :

- A tracking in a property/account with a view of 100% of my tracking with and without consent \> which that means than the collection is not based on cookie so less accurate
- A tracking based on the cookies so on my optin users.

Is it possible to do that with Piwik Pro ? I was thinking to get 2 accounts :

- One 100% PIwik Pro TMS+data collect
- One with Piwik Pro triggered by GTM

Do you think that my solution can work ?  
I’m a new user of PiwikPro, do not hesitate to correct me if I’m wrong of if you have a better solution.

Thank you for your help

---

<div class="post-metadata">

**Author:** ![sararekowska](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/sararekowska/32/1582_2.png) [@sararekowska](https://community.piwik.pro/u/sararekowska)\
**Post date:** [August 31, 2023, 11:46am UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818/2 "2023-08-31T11:46:33Z")

</div>

Hi there!

Welcome to our community 😄

For your case I would recommend to have two sites set up in Piwik PRO (by the way, you don’t need two accounts for that) - one for the 100% tracking and one for the tracking based on cookies. Since you can’t just add two containers to one website, you can use our addTracker method ([API — Piwik PRO Analytics Suite 18.0 documentation](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html?highlight=addtracker#addTracker)) in Tag Manager to get the same result. You would also need to set up both sites so they track data accordingly to your expectations. Here are some articles you may find useful:

> **[About site or app settings | Piwik PRO help center](https://help.piwik.pro/support/getting-started/about-site-or-app-settings/)**
>
> For each site or app, you can change settings for data collection, privacy and reports. In this article, we’ll go over each of these settings. To change site or app settings, follow these steps: Available from version 16.0.0. For versions below...

> **[About tracking code settings | Piwik PRO help center](https://help.piwik.pro/support/getting-started/about-tracking-code-settings/)**
>
> When you want to change the way the JavaScript tracker collects data, you can use the Piwik PRO tag in Tag Manager. To access tracking code settings, follow these steps:

Other than that, the solution you proposed would work too (you can do it on one Piwik PRO account only - no need to have two), the decision is up to you and your preferences 😄

---

<div class="post-metadata">

**Author:** ![romainproximity](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@romainproximity](https://community.piwik.pro/u/romainproximity)\
**Post date:** [August 31, 2023, 1:17pm UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818/3 "2023-08-31T13:17:40Z")

</div>

Hello @sararekowska

Thank you very push for your help.  
Il will try your method and let you know.

All the best

---

<div class="post-metadata">

**Author:** ![romainproximity](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@romainproximity](https://community.piwik.pro/u/romainproximity)\
**Post date:** [September 6, 2023, 12:54pm UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818/4 "2023-09-06T12:54:51Z")

</div>

Hello @sararekowska  
I tried to use your addTracker method to track the second site.  
But with the information you supplied I can’t figure out how.  
Where can I create a new JavaScript Tracking Client instance in Tag manager?  
Should I created a tag with the script ? Or should I ask to my dev team to implement this script in the pages :  
\_paq.push([“addTracker”, “[https://example.piwik.pro/piwik.php](https://example.piwik.pro/piwik.php)”, “45e07cbf-c8b3-42f3-a6d6-a5a176f623ef”]);  
Do you have any documentation for this procedure ?  
Thank you very much

---

<div class="post-metadata">

**Author:** ![sararekowska](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/sararekowska/32/1582_2.png) [@sararekowska](https://community.piwik.pro/u/sararekowska)\
**Post date:** [September 6, 2023, 1:41pm UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818/5 "2023-09-06T13:41:48Z")

</div>

Hi,

If you are using Piwik PRO Tag Manager - you need to create a custom code tag and put the snippet you provided (and also define the [\_paq](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html?highlight=_paq#command-queue) - which is a command queue):

```auto
<script>
var _paq = _paq || [];
_paq.push([“addTracker”, “https://example.piwik.pro/piwik.php”, “45e07cbf-c8b3-42f3-a6d6-a5a176f623ef”]);
</script>

```

And adjust the trigger conditions and consent settings in the tag 🙂

---

<div class="post-metadata">

**Author:** ![romainproximity](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@romainproximity](https://community.piwik.pro/u/romainproximity)\
**Post date:** [September 11, 2023, 1:36pm UTC](https://community.piwik.pro/t/double-tracking-piwik-pro/2818/6 "2023-09-11T13:36:55Z")

</div>

Hello @sararekowska

When you are written [https://example.piwik.pro/piwik.php](https://example.piwik.pro/piwik.php), in my case it should be [https://www.mysite.fr/piwik.php](https://www.mysite.fr/piwik.php) or “[https://mysite.fr](https://mysite.fr)”

To define the \_paq method, is it something that should be implement in my code source by my dev team.

Other question : I need to be compliant with french CNIL :

> **[How to make your website compliant with CNIL | Piwik PRO help center](https://help.piwik.pro/support/privacy/how-to-make-your-website-compliant-with-cnil/)**
>
> Commission Nationale Informatique & Libertés (aka CNIL) is the French data protection agency. The CNIL has listed Piwik PRO as a solution that can be used to collect some data without consent. So if you’re operating in France, you can take...

so what is the best way to be compliant :

- Site 1 : 100% tracking, not based on cookies with no consent type form
- Site 2 : only for consent, based on cookie with a cookie form  
Eg : if a user does not consent to my banner, it will be count in Site 1 but not in Site 2 ?  
Am I right ?

Thank you for your help
