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
Dimensions are not saved for manual goal conversions #16147
Comments
It is supposed to write into custom dimension in log conversion via the Why is this the case? Because we can still get the action dimensions for this conversion why the link from the So the tracking itself should be fine. It might be maybe more of a reporting issue that likely only conversion dimensions are shown in the reporting but not related action dimensions? This is likely same behaviour as for custom variables I reckon. |
Thank you for your reply! |
@mattab what do you think? It sounds to me like adding action dimension reports to goals "by dimension" report but not sure. Another way that may work (rather a workaround) would be to go to "Actions => $YourActionDimension" then apply a segment by Goal "Visit converted a specific Goal ID". You should see the dimensions used when it was converted but haven't tested it. |
That's my understanding as well. I wonder why we didn't implement it as it seems to make sense that action-dimensions would be duplicated in log_conversion. @code-penguin maybe you could create a pull request with your changes to have action dimensions stored in log_conversion? |
@mattab I have just created two pull requests with my changes: |
…o conversions directly in addConversionInformation()
…t; otherwise, use getCustomDimensionsInScope()
Hi guys, it looks my fix is not quite complete. The custom dimensions are now correctly stored in the log_conversion table, but there doesn't seem to be any way to then use them in reports. I think part of the problem is that Archiver::aggregateDayReport only adds custom dimensions to archives from visits and actions, and ignores the action dimensions stored in log_conversion. But even when I work around this, a segment on 'dimensionX=myvalue' will always return 0 for nb_conversions. Maybe one of you can look into this and let me know how it should work, so I can start making a fix. |
@code-penguin - What are the ToDos on this ticket? Only the reporting? This seems to be a quite good feature if it worked! |
@peterbo Did you check if that still doesn't work? I've just tested it with a manually triggered |
Hi @sgiehl ! - For visit scope custom dimensions, this works, but not for action scope Custom dimensions. This would make a lot of sense to attach multiple attributes to a conversion. Otherwise, you'd have to send an event along with all custom dimensions attached. But getting this reported afterwards is a nightmare. For example, the request: results in the following goal reported in the API: dimensions31/32/33 are all action dimensions. |
I guess that is actually by design. For the scope conversion the defined dimensions of scope visits are used, so there won't be any action dimensions tracked. See e.g. matomo/plugins/CustomDimensions/CustomDimensions.php Lines 335 to 356 in 539faea
|
@sgiehl - thank you for providing the code! Ok, I see. Having this would be great, also an action custom dimension report in the goals report would be a fantastic tool. For other users, that are pulling their hair out, searching for the reason, why this doesn't work, we should probably note this in the documentation until this might be implemented, because from a user's perspective, this is not self-explanatory (even if it makes sense from a coder's perspective): |
The "problem" is that the |
Great ideas, @sgiehl !! - I would vote for the scope conversion proposal. From an analytical perspective, conversion attributes are most often distinct from attribute types that are tracked for (behavioural) actions. And also from the coding perspective, this could make things a bit easier (no values would have to be kept in sync or doubled in the conversions table). The only place where it could make sense to copy values, is an event that triggers a goal (goal setting). In this case, it would make sense to copy the action dimenions (that were attached to the triggering event) to the conversion scope custom dimension. |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/custom-dimension-on-a-ecommerce-purchase/55146/2 |
This issue has been mentioned on Matomo forums. There might be relevant details there: |
I have the use case that I want to manually trigger a conversion when a user clicks on a button, and store additional data with that conversion. My goal is configured to allow multiple conversions per visit. For the data I have created an 'action dimension'.
I trigger the conversion manually as described in the documentation:
https://developer.piwik.org/guides/tracking-javascript-guide#tracking-a-custom-dimension-for-one-specific-action-only
_paq.push(['trackGoal', idGoal, customRevenue, {dimension1: 'DimensionValue'}]);
In this scenario, the custom dimension is not saved with the conversion; I would expect the custom_dimension_X field in each newly added row in the piwik_log_conversion table to be filled, but this is not the case.
I have taken a look at the code and think I have found the cause. In the CustomDimensionsRequestProcessor class the dimensions are only updated on visits (onNewVisit, onExistingVisit) and on actions (afterRequestProcessed), but not on conversions. To work around this I have modified CustomDimensionsRequestProcessor::afterRequestProcessed to temporarily store the dimensions as metadata on the request, and then retrieve this metadata in GoalManager::recordGoals and add it to the goal. With these changes the dimensions are now saved in the piwik_log_conversion table as expected.
Would love to hear your opinion on this, if there is any "proper" way to accomplish this or if it really is a bug / missing feature.
The text was updated successfully, but these errors were encountered: