Navigation Menu

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

Data bleeding over in bulk inserting with custom variables Nr. 2 #7245

Closed
iquito opened this issue Feb 19, 2015 · 8 comments
Closed

Data bleeding over in bulk inserting with custom variables Nr. 2 #7245

iquito opened this issue Feb 19, 2015 · 8 comments
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@iquito
Copy link

iquito commented Feb 19, 2015

The problems in #7217 still occur - I do not think the code mentioned changes anything. When doing bulk requests the sendRequest function is only called at the very end (to send all entries at once), so resetting the custom variables there would not change anything, as far as I see it.

I do not know where exactly the problem occurs - just that the bulk inserts get mangled together as soon as a custom variable with scope "visit" is set.

@mattab
Copy link
Member

mattab commented Feb 19, 2015

you will need to call clearCustomVariables() in your script to clear the custom variables between visits. As far as I see it works as expected. if you think i'm wrong please post script that reproduces and shows the problem. thanks

@mattab mattab closed this as completed Feb 19, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Feb 19, 2015
@iquito
Copy link
Author

iquito commented Feb 19, 2015

This does not really make sense to me, even though I have spent hours and hours with Piwik to customize it - when I insert log entries in bulk and set a custom variable with scope "visit", this does not mean every following entry should have that variable too, I only want to communicate to Piwik that this variable should be set to the whole "visit" of this user and not only one page. So when calling $t->doTrackPageView all custom variables should be reset automatically - this is what would be assumed from someone using the PiwikTracker class, because all other variables are reset too (IP, resolution, etc.).

Additionally, all the pages after setting the custom variable are combined into one huge visit, even though I set a visitor ID for every page - this seems clearly wrong, just setting one custom variable with scope "visit" should not provoke Piwik to combine all different visits into one, because a custom variable of scope "visit" is not a "unique" column or has any indication about which entries belong together.

@mattab
Copy link
Member

mattab commented Feb 19, 2015

Ok there may be an issue here...

$t->doTrackPageView all custom variables should be reset automatically - this is what would be assumed from someone using the PiwikTracker class, because all other variables are reset too (IP, resolution, etc.).

I assume that you call enableBulkTracking() at the start of your script.
if you do then every time you call doTrackPageView() it calls clearCustomVariables() which clears the custom var. It does not work for you? Maybe you can debug the code and even find where the bug is somehow? we would welcome a pull request 👍

@iquito
Copy link
Author

iquito commented Feb 19, 2015

Yes, that's exactly what I do - "visit"-custom-variables still cause the problems I mentioned.

I always thought the problem was within the API, not within the PiwikTracker-class, and that bulk tracking within the API maybe has some bug which causes this - because bulk tracking is probably used far less than the other methods (Javascript, 1-pixel-script) and it only occurs with visit-custom-variables, which is even more specific, so not many users actually witness this bug (or it occurs and they do not notice it - it is only really noticeable with large enough inserts).

Unfortunately I am not familiar with the Piwik code with the exception of the PiwikTracker class - but if you can point me in the direction where bulk requests are handled within the Piwik code, I will try to find the problem ;-)

@mattab
Copy link
Member

mattab commented Feb 19, 2015

it's possible the bug is in the bulkTracking but somehow I don't think so - this should work fine. Can you therefore check that the payload sent from the piwikTracker class is correct? if you can confirm it is correct, can you paste here this correct payload that then records wrong values in the Tracking API? we could use it to reproduce the bug. thanks

@mattab mattab reopened this Feb 19, 2015
@mattab mattab added Bug For errors / faults / flaws / inconsistencies etc. and removed answered For when a question was asked and we referred to forum or answered it. labels Feb 19, 2015
@mattab mattab added this to the Short term milestone Feb 19, 2015
@iquito
Copy link
Author

iquito commented Feb 20, 2015

I just started to add a second Piwik installation so I have a testing environment without affecting my actual statistics, but when trying to verify the data with via web interface I ran into this bug: #6189 - which seems to make it impossible to run two seperate piwik installations within one server, because I have the same fatal errors as in the bug.

If I cannot run two distinct Piwik installations, it makes it impossible to test, otherwise I gladly will provide the data & test some more.

@mattab
Copy link
Member

mattab commented Feb 23, 2015

@iquito we do successfully run several piwik installations on same machine... don't know about #6189 unfortunately

@mattab mattab modified the milestones: Short term, Mid term Apr 7, 2015
@mattab mattab closed this as completed Sep 11, 2015
@mattab
Copy link
Member

mattab commented Sep 11, 2015

see #6189 (comment)

@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants