Ecommerce Page Scope Custom Variable?


#1

Hi,

I am looking for a way to segment orders within the same user visit via an attribute X. I tried using page scope custom variables, but that only seems to work for page views and not ecommerce orders in the Ecommerce Overview widget.

Is there a way that I can achive this?


(Matthieu Aubry) #2

What and How exactly would you like to segment ? Maybe this is a legitimate feature request, that we could add to our issue tracker http://dev.piwik.org/


#3

I would like to segment ecommerce orders via an “order” scope custom variable similar to the effect of page scope custom variables and user visits. So the Ecommerce widgets could be segmented to only display data for orders based on the existence and/or value of the custom variable.


(Matthieu Aubry) #4

What segment “String” would you like to write ? see doc at: Segmentation: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

If that does not work with Piwik yet, please consider creating ticket on our issue tracker: http://dev.piwik.org/


#5

When tracking an ecommerce order via the function trackEcommerceOrder I also set a page scope custom variable “customerType”. A single visit may have mutiple orders with different values.

I then created a segment like the following “customVariablePageName1==customerType”. When using the segment the ecommerce widgets return 0 results.


(Matthieu Aubry) #6

Ok that’s clear. Could you please try to set a scope of “visit”, and then try to segment on visit scope? I think it may work because scope ‘visit’ custom variables are copied in the Conversion. Let me know!


#7

I am using the REST API for ecommerce tracking and the javascript tracker for page views. I only set the “customType” VISIT scope custom variable when sending the ecommerce data.

I can correctly see the VISIT scope custom variable, values and orders when I click “View goals by Visit -> Custom Variables”. However when I try to segment on the custom variable I see 0 results.

I have another visit scope custom variable that I set via the javascript tracker. I can segment orders correctly via that custom variable.


(Matthieu Aubry) #8

It does not work becasue the custom var of scope “page” do not work for conversions, only the scope “visit” can be segmented for conversions. This is I think an un-documented limitation (maybe we could mention this in some documentation ?)


#9

I made a typo in my last post…It should say Visit Scope and not Page Scope.

I tried your suggestion with the visit scope custom variable and those were my results. I edited my last post to correct it.


(Matthieu Aubry) #10

However when I try to segment on the custom variable I see 0 results.

What is the API request that you issue?