Joins between Tracking Tables

Hi I am trying to join between


however I am getting some odd results some records in piwik_log_link_visit_action have two matching records in piwik_log_action some with the same hash and some with different types.

Can someone help me understand the intended relationship between the tracking tables

What Join should I be using to join between piwik_log_link_visit_action AND piwik_log_action

Many thanks

you need to match the “type” column as well when joining the tables

Hi Matt,

Thanks for your response

This is an example of my query how do I join on type ? what are the join fields


  LVA.idlink_va as PK,
  LVA.idvisit, as URL, as Page_Action, as Reffering_URL, as Reffering_Page_Action

piwik_log_link_visit_action LVA,
piwik_log_action URL,
piwik_log_action Page_Action,
piwik_log_action Reffering_URL,
piwik_log_action Reffering_Page_Action

where LVA.idaction_url = URL.idaction
AND LVA.idaction_name = Page_Action.idaction
AND LVA.idaction_url_ref = Reffering_URL.idaction
AND LVA.idaction_name_ref = Reffering_Page_Action.idaction