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

Track landing page with custom dimension #16146

Open
tipmaster opened this issue Feb 7, 2017 · 5 comments
Open

Track landing page with custom dimension #16146

tipmaster opened this issue Feb 7, 2017 · 5 comments
Labels
c: Custom Dimensions For issues related to the Custom Dimensions plugin. c: New plugin For features that probably will not be added to Matomo, but could be implemented as plugins.

Comments

@tipmaster
Copy link

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?

@tsteur
Copy link
Member

tsteur commented Feb 7, 2017

and not override it on subsequent requests

Maybe custom dimensions in scope visit help?

@tipmaster
Copy link
Author

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?

@tsteur
Copy link
Member

tsteur commented Feb 7, 2017

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.

@tipmaster
Copy link
Author

Thank you.

To confirm there is no way for me to use the Javascript SDK to either

  • check if a custom dimension value has been set for the existing visit already
  • query if this is an ongoing or new visit

or is there?

@tsteur
Copy link
Member

tsteur commented Feb 7, 2017

Exactly

@tsteur tsteur transferred this issue from matomo-org/plugin-CustomDimensions Jun 29, 2020
@tsteur tsteur added c: Custom Dimensions For issues related to the Custom Dimensions plugin. c: New plugin For features that probably will not be added to Matomo, but could be implemented as plugins. labels Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Custom Dimensions For issues related to the Custom Dimensions plugin. c: New plugin For features that probably will not be added to Matomo, but could be implemented as plugins.
Projects
None yet
Development

No branches or pull requests

3 participants