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

create_new_visit_when_campaign_changes = 1 not working #12218

Open
eramirezprotec opened this issue Oct 23, 2017 · 9 comments
Open

create_new_visit_when_campaign_changes = 1 not working #12218

eramirezprotec opened this issue Oct 23, 2017 · 9 comments

Comments

@eramirezprotec
Copy link
Contributor

Hi! In the documentation I can read the following:

"By default Piwik will create a new visit whenever a visitor views your website using a different campaign information from the visitor’s ongoing visit. You can disable this behavior by setting create_new_visit_when_campaign_changes=0 under [Tracker] section in your config/config.ini.php file."

But it is not working for me. When I visit my website using different campaigns, Piwik registers always the same campaign established in the cookie a long time ago. It only changes when the session ends and I visit the website using a different campaign (but it has to be the first visit after the session ends, because if not, the old campaign is set again for the new visit).

Btw, is it the intented behavior to keep the same campaign even when the session ends and after that the user visits the site without any campaign specified in the url?

Thank you very much in advanced.

@sgiehl
Copy link
Member

sgiehl commented Oct 23, 2017

Do you have the Marketing Campaigns Reporting plugin installed?

@eramirezprotec
Copy link
Contributor Author

Hi, @sgiehl.

No, I don't have the Marketing Campaigns Reporting plugin installed.

@eramirezprotec
Copy link
Contributor Author

eramirezprotec commented Oct 24, 2017

This cookie _pk_ref.xxxxx contains information about the campaign and keyword; if I delete it, everything behaves the way it should (creating a new visit for every new campaign, no matter if one is inside the same session). Is this cookie really necessary?

@eramirezprotec
Copy link
Contributor Author

For now, we have chosen not to set this cookie (_pk_ref.xxxxx), this way everything behaves as we want to. The problem is when this cookie is set, and this happens when the first visit to the site (I mean, without an active session) ocurres with a campaign (URL?pk_campaign=c1, for example); after this, no matter what you do, all new visits (with or without campaigns) are going to be associated with the campaign set in the previous example. All of this happens because of _pk_ref.xxxxx cookie.

@peterbo
Copy link
Contributor

peterbo commented Jun 8, 2018

Came here because of the forum issue https://forum.matomo.org/t/campaign-is-there-a-tracking-timeout-after-user-clicks-one-link/28690/7 - this is reproducible in my instance as well.
This is because of

|| !campaignNameDetected.length) {
- if a campaign referrer was obtained from the cookie, the check for (changed) parameters from the url is not run at all. So the cookie campaign information has precedence over the actual campaign info in the url and the parameter "create_new_visit_when_campaign_changes" cannot have any effect (only with cookies disabled or deleted).

@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/issues-with-campaign-handling/48989/1

@heurteph-ei
Copy link

@peterbo, @sgiehl
Isn't it covered by #19657?

@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/issues-with-campaign-handling/48989/2

@sgiehl
Copy link
Member

sgiehl commented Jan 12, 2023

@heurteph-ei Actually not sure about that. Will keep this issue open, so we maybe have another detailed look when working on #19657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants