So I was running this query on the piwik database and found out that for the same visit (idvisit), if a goal was converted during that visit, the referer type/name is not the same in both tables?
Here is my query:
v.referer_type AS 'Visit referer_type', c.referer_type AS 'Conversion referer_type' FROM piwik_log_conversion c JOIN piwik_log_visit v ON c.idvisit = v.idvisit
WHERE c.referer_type <> v.referer_type LIMIT 10 ;
We have the referer_type and referer_name as columns of log_conversion, and those columns are not in the documentation. Moreover, they do not necessarily match the information stored in the visit that made the conversion. Any clue?
I’ve also encountered this behavior and we do not use the _paq.push(['setConversionAttributionFirstReferrer', true]); either. The faq 106 suggests that piwik looks at the last non direct entry ref type of current visitor, but I’ve found that there are conversions in which the last visits to conversion were all direct entry yet it was not attributed to direct entry.
FAQ 106 says “Piwik will credit this Goal conversion to the last non empty referrer used by the visitor”, but non empty as in referer_url is not empty or that referrer_type is not 1, which does it consider, since referer_url can be non empty yet referer_type can be 1 in the log visit table.
Ok after digging around piwik, I see that it looks at the information from the cookie, to determine the referer_type of a conversion entry in the conversion log table. Piwik prioritizes the cookie information over what the current visit had entered in the visit log table. I assume as it has been said, that when piwik can’t get any information from the cookie it defaults to using the last non direct entry referer type from the visit log table for the conversion referer_type.