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

I Have A Problem With [JavaScript Tracking] #15967

Closed
Lijiaqi1992 opened this issue May 21, 2020 · 3 comments
Closed

I Have A Problem With [JavaScript Tracking] #15967

Lijiaqi1992 opened this issue May 21, 2020 · 3 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@Lijiaqi1992
Copy link

Lijiaqi1992 commented May 21, 2020

I use this code to set my web,
like
_paq.push(['setCustomVariable','3','u3','3']);.
But it not always effective.
This is my Mysql data
image
And it also not in table:matomo_log_link_visit_action
Why? Please me where is the problem?

@Findus23
Copy link
Member

Hi,

Did you check if the data is included in the request to matomo.php? Also make sure the variable is set before the page view is tracked.

@Lijiaqi1992
Copy link
Author

Hi,

Did you check if the data is included in the request to matomo.php? Also make sure the variable is set before the page view is tracked.

Yes,Thanks!
I changed the code _paq.push(['trackPageView']); under the code _paq.push(['setCustomVariable',1,'mykey','myval']); . It work now!
How can I avoid such things happening again?

@tsteur
Copy link
Member

tsteur commented May 22, 2020

Glad it works now @Lijiaqi1992

The only way to avoid such things is testing any tracking changes work as expected unfortunately. So whenever you're wanting to set new custom variables make sure to test them and check that you're afterwards getting the data in the reports as expected.

@tsteur tsteur closed this as completed May 22, 2020
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants