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

Tracker API: trim spaces in event names, category, actions #15501

Closed
mattab opened this issue Feb 3, 2020 · 9 comments
Closed

Tracker API: trim spaces in event names, category, actions #15501

mattab opened this issue Feb 3, 2020 · 9 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. RFC Indicates the issue is a request for comments where the author is looking for feedback. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 3, 2020

Currently in the Tracker API we do trim content names, pieces, targets strings. To be consistent we could also trim event names (e_n), event category (e_c), event actions (e_a).

We could even trim a couple of other inputs where it could make sense like Page title (action_name), possibly site search keyword (search, search_cat).

fyi: creating this issue as a result of a user and developer getting confused about duplicate data in an Events report. Problem solved by "invisible empty space".

@mattab mattab added c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. RFC Indicates the issue is a request for comments where the author is looking for feedback. labels Feb 3, 2020
@tsteur tsteur added this to the 4.2.0 milestone Feb 3, 2020
@tsteur tsteur added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Feb 3, 2020
@tsteur
Copy link
Member

tsteur commented Feb 3, 2020

sounds good

@flamisz flamisz self-assigned this Feb 24, 2021
@flamisz
Copy link
Contributor

flamisz commented Feb 25, 2021

Hi @mattab and @tsteur
I was looking into this issue and this is what I found:

I believe the search and search_cat already trimmed here:
ActionSiteSearch

I checked the action_name, found a place where it should be trimmed, I make a PR for that.

I check the other request parameters too.

EDITED:

I checked the other parameters and they all looking good to me: either not string, or goes through some kind of validation or trimmed.
Do I miss something here?

@tsteur
Copy link
Member

tsteur commented Feb 25, 2021

@mattab looks indeed like event names etc are already trimmed (by looking at code, not reproducing). Do we maybe otherwise still have the link to the original conversation?

@mattab
Copy link
Member Author

mattab commented Feb 28, 2021

@tsteur sure, you can find it in conversation #641565

@flamisz
Copy link
Contributor

flamisz commented Feb 28, 2021

@tsteur sure, you can find it in conversation #641565

@mattab what is this number? where can I find this conversation?
thanks

@mattab
Copy link
Member Author

mattab commented Mar 2, 2021

Here is what user wrote:

The empty space was in the "ACTION" I have sanded throw the _paq.push("trackEvent",…) function, so I thought if the developer has any mistake in his code, then you can also trim the text.

Before:

I will ask to update our Matomo version.
Problem solved by "invisible empty space".
Maybe it is better to have a "trim" function when you receive the tracker.

Before (original report):

I have a new problem using the goals and funnels,
I build a new goal with few steps and a funnel.
Every time the user gets a specific level, the funnels goes out and it never finish the funnel.
As you can see, I'm sending in the network panel the required action.
screenshots missing but not relevant anyway

@flamisz
Copy link
Contributor

flamisz commented Mar 2, 2021

Thanks @mattab, it's useful. In this case indeed the action name was the problem. The PR will fix that.

@sgiehl
Copy link
Member

sgiehl commented Mar 10, 2021

@mattab it seems all action/event names are meanwhile already trimmed. The funnel problem was already solved in a L3 issues, so guess there is actually nothing left to do here. If the user is still having that issue, maybe he can describe the issue a bit more clearly, so it's easier for us to look for a potential reason.

@flamisz flamisz removed their assignment Apr 14, 2021
@tsteur
Copy link
Member

tsteur commented Jun 9, 2021

closing for now and we can reopen if that should appear again.

@tsteur tsteur closed this as completed Jun 9, 2021
@tsteur tsteur added the worksforme The issue cannot be reproduced and things work as intended. label Jun 9, 2021
@mattab mattab modified the milestones: 4.6.0, 4.5.0 Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. RFC Indicates the issue is a request for comments where the author is looking for feedback. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

4 participants