Prefixing matomo first party cookies generating extra cookie

Hi ,

We have a situation where we cannot use matomo default first party cookies as there is already matomo working . Is there a way to rename/prefix matomo default first party cookies or what could be the alternative solution ?

Thanks
Saqib

Just an update I used setCookieNamePrefix but still there is one extra cookie with default name.

Is this a bug ?

Hi all, this is on version 3 but we’ve tried two different versions and it always creates that third cookie unnecessarily. We haven’t tested on version 4 but that’s too new to upgrade to at the moment. Can it at least be confirmed that it is a bug that needs fixing? The Matomo documentation (https://developer.matomo.org/api-reference/tracking-javascript) states that SetCookieNamePrefix should amend all the cookies so needs fixing if this isn’t the case.

Hi,

Looks it has been solved in matomo 4.0.0

And as work around we used following javascript tracking code:

    <script type="text/javascript">
	
    (function () {
       var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.example-domain.com/matomo3.4/";
        var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0]; g.type = "text/javascript";
        g.defer = true; g.async = true; g.src = u + "matomo.js"; s.parentNode.insertBefore(g, s);
    })();
	
    window.piwikAsyncInit = function () {
        try {
             var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.example-domain.com/matomo3.4/matomo.php";
			 
			 var Tracker = Piwik.getTracker();
				 Tracker.setCookieNamePrefix("_dso_");
				 Tracker.setSiteId( 1 );
				 Tracker.setTrackerUrl( u );
				 Tracker.trackPageView();
			
        } catch( err ) {
			
			console.log(err);
		}
    };
</ script>

Regards,
Saqib