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 ?


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 ( states that SetCookieNamePrefix should amend all the cookies so needs fixing if this isn’t the case.


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") + "://";
        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") + "://";
			 var Tracker = Piwik.getTracker();
				 Tracker.setSiteId( 1 );
				 Tracker.setTrackerUrl( u );
        } catch( err ) {
</ script>