Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Matomo 4 #76

Open
tsteur opened this issue Sep 18, 2020 · 5 comments
Open

Compatibility with Matomo 4 #76

tsteur opened this issue Sep 18, 2020 · 5 comments

Comments

@tsteur
Copy link
Member

tsteur commented Sep 18, 2020

Hi there,

this issue refs matomo-org/matomo#16397 (comment)

in Matomo 4 we're changing the structure of the visitor cookie. I don't know if this SDK reads the cookie of a visitor if one is set?

In the PHP tracker we had to make this change because of it https://github.com/matomo-org/matomo-php-tracker/pull/79/files#diff-cd22a4ca6eb55e6a5ad813334624ed89L1370-L1840

The cookie was changed in https://github.com/matomo-org/matomo/pull/15774/files#diff-1279d666063b65e6d6777f902d11574fR3322-R3330

It used to contain 6 indexes (newVisitor, uuid, createTs, visitCount, currentVisitTs, lastVisitTs) but now contains only indexes:
Slot 0: newVisitor
Slot 1: uuid
Slot 2: createTs

Basically, if this tracker does read the cookie, then the tracker needs to be changed to only read the first to slots from the cookie (cookieVisitorId and createTs) see https://github.com/matomo-org/matomo-php-tracker/pull/79/files#diff-cd22a4ca6eb55e6a5ad813334624ed89L1370-L1840

All other information from the cookie list visit count, currentVisitTs, lastVisitTs is no longer needed in Matomo 4.

If this tracker does not read any cookies then it can be ignored.

alona-lip added a commit to alona-lip/piwik-dotnet-tracker that referenced this issue Jan 26, 2021
alona-lip added a commit to alona-lip/piwik-dotnet-tracker that referenced this issue Jan 27, 2021
alona-lip added a commit to alona-lip/piwik-dotnet-tracker that referenced this issue Jan 27, 2021
alona-lip added a commit to alona-lip/piwik-dotnet-tracker that referenced this issue Jan 27, 2021
@epos
Copy link

epos commented Jan 29, 2021

Thank you @alona-lip for the proposed fix. However when I try your #79 fix for this problem, I still get an HTTP 400 error. The called URL is :

https://piwik.<our domain>.com/piwik.php?idsite=11&rec=1&apiv=1&r=250779&cip=::1&_idts=1611940818&_id=7b2be05759a2bc7d&url=http%3a%2f%2flocalhost%2fdefault.aspx&e_c=mycat3&e_a=myact3

Currently I'm stuck not being able to call the tracking API from .NET. We have Matomo 4.1.0.

@alona-lip
Copy link
Contributor

Hello @epos ,
Are you sure that your problem has really something common with this PR ?

I did not have 400. I had OutofRange Exception by LoadVisitIdCookies.

These changes should be tested from the Matomo Side (after they fix the CI Build Problem),
and should be as an Update to Piwik.Tracker 3.0.0.0 (Nuget-Package) provided.

How did you test it? Have you compiled the changes and made the Nuget-Package by yourself?

@alona-lip
Copy link
Contributor

Hello @tsteur ,
could you please test this PR as soon as possible and provide the Update to Piwik.Tracker 3.0.0.0
The Update of Piwik.Tracker (.NET) Nuget Package ist critically important for us.

Thanks & Best Regards,
Alona

@mattab
Copy link
Member

mattab commented Feb 1, 2021

@alona-lip Thank you very much for your Pull request submissions, very appreciated!

I have merged it for now as we have no maintainer currently in the project, have just created a new issue: #80

mattab pushed a commit that referenced this issue Feb 1, 2021
* bugfix Tracker reads the first two slots from the cookie (cookieVisitorId and createTs), ref #76

* UnitTest ref#76

* UnitTest Extension ref #76

* UnitTest Extension ref#76
@epos
Copy link

epos commented Feb 5, 2021

Are you sure that your problem has really something common with this PR ?

Thank you for your answer @alona-lip. The problem was indeed not due to this PR, but I couldn't know this at the time of asking since I was also struggling with the visitor cookie structure change. I isolated that other problem, and created a proper issue :

#81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants