Open tipmaster opened 7 years ago
and not override it on subsequent requests
Maybe custom dimensions in scope visit help?
We are using custom dimensions with the scope "visit".
However, from the documentation:
Custom Dimensions in scope “Visit” can be sent along any tracking request and are stored in the visit of a specific visitor. If you set different values for a given dimension during the lifetime of a visit, the last value set will be used. A typical example could be any device information or the version of the app the visitor is using.
So our question is how can we use javascript to ensure the value is only set once when the visit starts?
Got it. You would probably need to set a cookie or something once you set the custom dimension the first time and then make sure it won't be overwritten anymore. However, this may be bit tricky since you won't know when it is a new visit. Eg visitor might visit website and you set custom dimension and cookie. Visitor comes back 40 minutes later => Piwik creates new visit, you would need to set the custom dimension again but the cookie you set would likely prevent this since you cannot know when Piwik creates a new visit.
To solve this, a custom Piwik plugin would be likely needed.
Thank you.
To confirm there is no way for me to use the Javascript SDK to either
or is there?
Exactly
I am trying to figure out how I can set the custom dimension field only for a landing page and not override it on subsequent requests; is this possible to do with javascript? Can I check if the value is set conditionally in JS?