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

Manually changing the custom_dimension_X fields to be unlimited length column (TEXT type) instead of VARCHAR 255? #79

Open
mattab opened this issue Dec 8, 2017 · 2 comments

Comments

@mattab
Copy link
Member

@mattab mattab commented Dec 8, 2017

Currently custom dimension values are limited to 255 characters, but in some cases we want to track more than 255 characters in a custom dimension.

Currently, if trying to issue a request with a dimension value longer than 255 chars, the tracker API request will fail with an error like

Exception: Error query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'custom_dimension_2' at row 1 In query: INSERT INTO piwik_log_visit (idvisitor, config_id, location_ip, idsite, visit_first_action_time, visit_goal_buyer, visit_goal_converted, visit_last_action_time, visitor_days_since_first, visitor_days_since_order, visitor_returning, visitor_count_visits, visit_entry_idaction_name, visit_entry_idaction_url, [...], campaign_content, campaign_id, campaign_keyword, campaign_medium, campaign_name, campaign_source, custom_dimension_1, custom_dimension_2)

When manually changing the column type from VARCHAR 255 to TEXT, then the data is tracked properly, and displayed correct in the reports.

---> For users who need to track more than 255 chars, can we recommend them to manually change the DB schema column type to TEXT field? is there any possible problem with this solution?

@mattab mattab added this to the Current sprint milestone Dec 8, 2017
@mattab mattab changed the title Manually changing the custom_dimension_X fields to be unlimited length fields instead of VARCHAR 255? Manually changing the custom_dimension_X fields to be unlimited length column (TEXT type) instead of VARCHAR 255? Dec 8, 2017
@tsteur

This comment has been minimized.

Copy link
Member

@tsteur tsteur commented Dec 8, 2017

Yes would definitely not making this the default. And would also possibly trim after 255 characters to avoid errors and rather not fully tracking it instead of failing.

@mattab

This comment has been minimized.

Copy link
Member Author

@mattab mattab commented Dec 10, 2017

Maybe the columns could be to TEXT type in the Custom Dimensions release for Piwik 4.0.0 in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.