Mattias Bodlund 3 days ago
parent
commit
5cb549c85a
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/controllers/concerns/utm_tracking.rb

+ 5
- 1
app/controllers/concerns/utm_tracking.rb View File

@ -6,6 +6,8 @@
# posts to game#start. The tags are therefore parked in the session on the way
# in and read back out when the player is created.
#
# Matomo-style mtm_* parameters are accepted as aliases for the utm_* ones.
#
# Last touch wins: a second scan is a second visit, and the player row that
# follows it belongs to the code that was actually scanned.
module UtmTracking
@ -22,7 +24,9 @@ private
def capture_utm
tags = Player::UTM_KEYS.index_with { |key| clean_utm(params[key]) }.compact
tags = Player::UTM_KEYS.index_with { |key|
clean_utm(params[key].presence || params[key.to_s.sub("utm_", "mtm_")])
}.compact
return if tags.empty?
# String keys: the session round-trips through the cookie, which has no


Loading…
Cancel
Save