Pre-process segments with dynamic value

For a site of mine I track banner stats through the customVariables. I request these stats through the widget on our control panels. This works but performance is getting bad because these segmentations are not pre-processed by the archive task.

Is it possible to pre-process segmentations that contain a dynamic value? For example:


customVariablePageName1==Banner_511,customVariablePageName2==Banner_511,customVariablePageName3==Banner_511,customVariablePageName4==Banner_511,customVariablePageName5==Banner_511;customVariablePageValue1==Impression,customVariablePageValue2==Impression,customVariablePageValue3==Impression,customVariablePageValue4==Impression,customVariablePageValue5==Impression

In this case the custom variable Banner_ is dynamic.

What would be a good solution to solve this problem?

Thanks!

What would be a good solution to solve this problem?

Honestly for tracking banner impressions and clicks the very best solution is to use content tracking being worked on in this issue https://github.com/piwik/piwik/issues/4996

It will be released in 2.7.0 so your feedback will be greatly appreciated!

Hi matt,

Thanks for your answer. Sounds very good! I read all documentation and do not have much in depth feedback. Looks to me you are considering alot of use cases regarding how to detect content on a page. Though I run Piwik server-side as an GA alternative. Server-side so can track without worry too much about these tracking/cookie laws. Like a non-js alternative.

So I am pushing in all stats to the API using the PHP library. I assume it is possible for me to add these stats manually? Is not clear from docs right now, or haven’t read properly. It would be very appriciated if these javascript calls are available through the library too with adding custom content data manually. I bet they will, because it’s just an API. But ready library methods would be very useful.

Thanks for this great product!

So I implemented the Content Tracking feature. MUCH better! Thank you.

But… performance is still bad when requesting charts. So I am left with the same problem. I cannot find anything in the docs to make the stats being archived per content name segment.

This must be a common problem when using this feature. What’s the best way to solve?

To pre-process segments with dynamic values, you can edit your segment and set them as “Pre-processed”

Matt,

Where can I find info about this?

My content names are:


Banner_35864
Banner_35057 
Banner_29195 	
Banner_34788 	
Banner_34792
etc...

I can only find info about using config.ini.php. But I can’t do like:


Segments[]="contentName==Banner_*"

right?

So How do I process these dynamic values?

The strange thing is. When I open content graphs through piwik it works instant. When I open them through my CMS using widgets it is very slow:


index.php?module=Widgetize&action=iframe&columns[]=nb_actions&columns[]=nb_visits&widget=1&moduleToWidgetize=VisitsSummary&actionToWidgetize=getEvolutionGraph&idSite=8&period=day&date=today&disableLink=1&widget=1&segment=contentName==Banner_335&token_auth=XXXXXXXXXX

What would be the difference?

Hope you can help me with this once more.

Thanks for your time!

a plugin could be created to pre-process dynamic segments. in the meantime the best solution is to add them to the config file with Segments[] = x

So I added:


[Segments]
Segments[] = "contentName==Banner_38271"

Run the archive cron. It says:


INFO CoreConsole[2014-10-27 10:50:36] [8a293] - Will pre-process 2 Segments for each website and each period: contentName==Banner_38271, customVariablePageName1==Version;customVariablePageValue1==Mobile

But nowhere futher in the log it says it is processing Banner_38271. Just these lines:


INFO CoreConsole[2014-10-27 10:50:43] [8a293] Will pre-process the following 1 Segments for this website (id = 7): customVariablePageName1==Version;customVariablePageValue1==Mobile
INFO CoreConsole[2014-10-27 10:50:45] [8a293] Archived website id = 7, period = day, 1599 visits in last last2 days, 325 visits today, Time elapsed: 4.609s
INFO CoreConsole[2014-10-27 10:50:45] [8a293] Will pre-process the following 1 Segments for this website (id = 7): customVariablePageName1==Version;customVariablePageValue1==Mobile
INFO CoreConsole[2014-10-27 10:50:51] [8a293] Archived website id = 7, period = week, 8762 visits in last last2 weeks, 325 visits this week, Time elapsed: 6.042s
INFO CoreConsole[2014-10-27 10:50:51] [8a293] Will pre-process the following 1 Segments for this website (id = 7): customVariablePageName1==Version;customVariablePageValue1==Mobile
.... etc

Apperently it is not needed? The thing that bothers me is that the Piwik panel graphs are instantly loading, for banners also. But the graphs through widgets using ‘actions’ (impressions not supported yet) is sooo slow. Would it be fixed when impressions graphs are supported in widgets?

I seem to have fixed performance issues by getting the graph exact same way the Piwik panel does. Solution is here:
http://forum.piwik.org/read.php?2,121180,page=1#msg-121483