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
Problem: Method Contents.getContentPieces #15121
Comments
Checked a similar call on my local installation and it returns the expected data. |
@tedo-develop can you ideally also let us know the exact segment string in the query that you are using? We did change a few things around encoding so maybe there's an issue. To reproduce we will need to know the exact segment string. |
@sgiehl i tried day, week, month result: [] (empty response). My first suspicion was, that there are no data in these ranges. But a look in our databases shows me that the last data were received on 2019-10-31. I'm not sure when we have exactly updated but i think it was on last week. @tsteur thats are the segments we call. Hope you have all infos you need: Complete request (rawurldecoded): Last successful call (2019-10-31): Response after update: As you see, i get data but not the expected. The second array is that response what i would expected. In my opinion, i should get only the second array as response, correct? I have also spoken with our developers, nobody have change something. Maybe the call was the whole time incorrect? |
We have a similar issue. When using segments we get confusing/wrong results. We use the API method This is no longer working. The segment filter is ignored. We also did not change anything on the code side. |
@diosmosis do you have any idea why #15121 (comment) might no longer work? |
@franzdumfart some ideas why the call not working for you? Which matomo version have you? We working with v.3.12.0. As far as we known, just the contentPiece segment is affected. We tried simple calls like |
@tedo-develop how exactly would you describe "wrong results"? Be good to explain further so we can understand better |
Same call as i subscribed in #15121 (comment). But this time we have tried a simple string just As you can see in #15121 (comment) the search string was The expected result was: But we get: |
@tsteur I thought it might be the segment encoding, but that doesn't appear to be the case since decoding the segment twice doesn't change any of the values used in the segment. To be sure we could try the segment w/ twice encoded values to see if that provides a different result, ie,
or
|
The description of @tedo-develop sounds expected behaviour which is due to #11900 where we fixed an issue and it's expected that more results (other labels) are not shown. It used to be a bug that no other labels are shown. Not sure if there's still an issue though when there is no data. @tedo-develop could you try the suggested segment string in the URL for example? |
@tedo-develop Using the same version as you. On my end the segment filter will be ignored. No difference when using it. |
This is expected behaviour since Matomo 3.12 see #11900 . It was a bug that it was showing only the matching one. Filters help indeed in this case 👍 The contentTarget we actually removed in 3.12.0 as it was buggy and potentially showing wrong information (eg if there's one content piece with two different content targets). |
Okay I've found a way to fix this problem when fetching But getting event data (
When trying to get the same data via different settings (we use this repo for fetching matomo data: https://github.com/RobBrazier/Laravel_Piwik)
I'm getting two results. But my guess is that the data is correct. When changing the segment the results are also changing, so the segment does some filtering. So there seems to be wrong results somewhere. Any idea? |
@franzdumfart as i described in #15121 (comment). It seems that filter_pattern is the only way to get "the correct result". @tsteur if i understood everything right. I can't request anymore contentName==Banner&contentPiece==Company1 ? But the doc says that we can combine segments for filtering? |
@tedo-develop Yeah but how can I get event data by name, category and action? Because in my example I can not search by filter_pattern because at this point the label does not include the name I'm searching for. For me this seems like a bug. |
@franzdumfart for me too. My suggest was only an idea how you can get your needed results. Would be nice if the segments working again. If not, please let us know, so we can change our requests to avoid unnecessary requests. Luckily our code can handle the overhead.... |
you can still combine multiple segments to narrow down your visitors.
This is really how segments are supposed to work. Most users would argue it was buggy before so it's bit tricky and we can understand the frustration. There is no way to make everyone happy. You can disable this behaviour for a while but we might remove this flag in Matomo 4: You can disable it by adding this in
Another alternative be to use Custom Reports which supports Segment Filters (which are different from segments). |
@tsteur thanks for your help. I know that it is not possible to make everyone happy :). |
Thanks for your understanding @tedo-develop I'll close the issue for now. Let me know if there's anything unclear otherwise and can reopen. |
Hello,
i tried to get contentPieces from matomo via api call.
I'am really sure that the call below worked for nearly 2 years (the call was never changed).
index.php?module=API&method=Contents.getContentPieces&idSite=1&period=day&date=2019-10-30&filter_limit=100&format=json&segment=contentName%3D%3DNameOfContent%3BcontentPiece%3D%3DNameOfContentPiece
I get a response, if i call the api with
&segment=contentName==NameOfContent
But i get no response if i call the
&segment=contentPiece==NameOfContentPiece
Also no response if i call a combination e.g.
index.php?module=API&method=Contents.getContentPieces&idSite=1&period=day&date=2019-10-30&filter_limit=100&format=json&segment=contentName%3D%3DSuper%20Top%20Banner%3BcontentPiece%3D%3Da-877-10177040-IGE%252BXAO%2BSoftweare%2BVertriebs%2BGmbH
What did i wrong? Is there any bug known?
The text was updated successfully, but these errors were encountered: