Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#855 closed New feature (fixed)

Campaign name and keyword variable names should be defined in a list, and should include utm_* by default.

Reported by: matt Owned by: matt
Priority: major Milestone: Piwik 1.3
Component: Core Keywords:
Cc: Sensitive: no

Description

Currently you can customize campaign parameters by editing config/config.ini.php and adding the following:

; variable name to track any campaign, for example CPC campaign
; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC' then it will be counted as a campaign referer named 'Adwords-CPC'
campaign_var_name			= piwik_campaign

; variable name to track any campaign keyword
; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC&piwik_kwd=My killer keyword' then it will be counted as a campaign referer named 'Adwords-CPC' with the keyword 'My killer keyword'
campaign_keyword_var_name	= piwik_kwd

New proposal:

  • each variable can be an array, so we can define multiple variable names
  • because GA defines 4 variable for campaign tracking (see URL builder), we would have to define Piwik campaign name, and keyword, by a concatenation of these. For example:
    # Campaign Name
    campaign_var_name[] = piwik_campaign
    campaign_var_name[] = "{$utm_campaign} {$utm_source} {$utm_medium}"
    
    # Keyword
    campaign_keyword_var_name[] = piwik_kwd
    campaign_keyword_var_name[] = utm_term
    

Note: as a more complex alternative, we can also contemplate adding a level in the campaign table, to handle 3 or 4 levels (for example, reusing the existing data table used for page views, that has infinite number of levels.


Change History (9)

comment:1 Changed 4 years ago by matt (mattab)

  • Sensitive unset

see also #1198

comment:2 Changed 4 years ago by matt (mattab)

  • Milestone changed from 4 - Piwik 1.0 - Stable release to 3 - Piwik 0.9 - Surviving The Wild

comment:3 Changed 4 years ago by matt (mattab)

When campaign variables are tracked, they should be removed from the URL being recorded in Piwik so that real pages aggregate in the reports.

comment:4 Changed 4 years ago by matt (mattab)

  • Milestone changed from 3 - Piwik 0.9 - Surviving The Wild to 5 - Piwik 1.1
  • Owner set to matt

comment:5 Changed 3 years ago by matt (mattab)

  • Milestone changed from 1.1 - Piwik 1.1 to Piwik 1.x

comment:6 Changed 3 years ago by matt (mattab)

  • Milestone changed from 1.x - Piwik 1.x to 1.2 Piwik 1.2
  • Type changed from Bug to New feature

comment:7 Changed 3 years ago by matt (mattab)

What should happen when we see both a campaign parameter in the URL as well as a Website in the referer?

Technically we could credit the visit to both, but count conversions only for the campaign (to avoid overcounting). We should see how other tools handle this (haven't looked yet).

This might need a new ticket for later improvements as tracking both Referers name & campaign details will require schema update, which is also required to support all GA campaign parameters.

comment:8 Changed 3 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(In [4389]) Fixes #855 Now detecting google style campaign parameters (utm_campaign, utm_term)

comment:9 Changed 3 years ago by matt (mattab)

Note: See TracTickets for help on using tickets.