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
Campaigns referers are not attributed to Goal Conversions #2168
Comments
From piwik.org/docs/javascript-tracking/ If that doesn't give you the desired effect, please post samples showing observed and expected results. |
I have tested setConversionAttributionFirstReferrer( true ), but this changes nothing. I made some tests: If i hit this link a new Visitor is tracked as an vistor from testsource with keyword testcampaign. Everything is ok. In the database the log_visit table shows me: If i now go to a second site where i track manualy a goal, a conversion is tracked, but in the log_conversion table it shows me: I take a look on the core/Tracker/GoalManager.php an this happens becaus the GoalManager analyses the referer again. $referrer = $referrer->getRefererInformation($refererUrl, $currentUrl = '', $idSite); Because the currentUrl is empty, the referer Class cannot detect the campaign. I have made a patch that fixes this for me. |
Attachment: |
Thanks for the patch lcb! I will commit soon |
Actually, the patch is not enough. Technically, we should detect the campaign parameters in the piwik.js and store the "campaign name & keyword" in the cookie. Imagine the use case
We could maybe just store the actual parameters, pre-parsed, in the first party cookie. Currently these parameters are piwik_campaign and piwik_kwd Maybe the best solution would be to move the Campaign detection in the piwik.js all together, similarly to what GA and others are doing? |
(In [4229]) Refs #2168: thanks lcb for report & patch This will attribute the campaign correctly, if the Goal happens on the first Visit. The campaign will not be attributed when Goals are triggered on subsequent visits and when a Campaign was the Referer used to reach the website, in a previous visit. |
Proposal for fix: piwik.js will detect the campaign name & keyword parameters in the landing URL, when the visit is new. It will then store in a separate new cookie (same lifetime as referer cookie). The values to store are the name and keyword. When a campaign is stored in the cookie, the _ref cookie is NOT deleted. Later, we might decide to align with GA campaign tracking model ( 4 dimensions). The piwik.php tracker will then read these values and pick which one is preferred (the campaign is by default, higher priority than another URL referer) thoughts? |
Sounds good. (Other than the first party cookie overhead on each request and GET request length limits...) |
As an update to my previous implementation suggestion, I propose that campaign name/keyword are stored in the _ref cookie along with ref url & ref timestamp, as to simplify cookie space (if there is no campaign, or no referer, the first (or last) fields are empty as they are fixed size) |
I have to stop for the day, here is patch of current status What is missing:
I noticed the JS fails JSLint, Anthon do you run the piwik.js via the online test tool when the test fails? (just checking) feedback welcome... i'll finish tomorrow |
Attachment: |
I haven't looked at the patch, but yes, ci has a job to test against the latest online jslint. |
re: piwik.js:
|
(In [4370]) refs #2168 - fix bug per matt's email |
OK thanks for the JS review I'll change it
|
I'm adding the JS tests, this stuff is cool man!! |
The test framework can use mock functions (replacing setCookie/getCookie) for testing. This will make it easier to test the code that loads the visitor and referrer cookies, and that handles a new visit. |
(In [4378]) Fixes #2168
Refs #2172
Refs #2222 Accurate Paypal tracking (or any other third party "after the fact" Goal conversion): implementation is now done, we must write some kind of guide and test |
Since 1.2 the Goalmanager uses the refering URL and the current URL, not the entry URL to determine the referer. But only the entry URL has campaign infos, so this info is lost.
The Goalmanager should use the existing data from the current Visitor and not analyze the referer a second time.
The text was updated successfully, but these errors were encountered: