utm_tracker 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6b0ea8d700180ef1c10d945b8580cabfd8aab4ed89316a5a914c59f3b4fd2fa
4
- data.tar.gz: 3a2e90a56046b068e2da798eb4a41693ee1e6b1b397543a4cea30f19a28de1bd
3
+ metadata.gz: 742f4df4fc29dcb39d6c6382cd86c586c87b587c57a5698e3f61a0617b8f6eff
4
+ data.tar.gz: ceb12c6fbfc6d37f93aea140a49832986d412b77a8c67f7af0f266eb519db678
5
5
  SHA512:
6
- metadata.gz: '09e1230eaaee7395fa4e8197814f7dc4d92286ff472e5cf52cb1cbb2f3cafa917fe276d3ab4d69e4636665ef4b8f352b8a7dbf0fc7e35ab5b192a7f20221a2b4'
7
- data.tar.gz: e12d148e3e1ef2de009dd8545c03ab6ac0b95b551c10487f54c264237d9e93cb51da255a48492a4dd27ccaeb21d87d2236a16acd4df181b6eac0190da28cad27
6
+ metadata.gz: f4ce1455cee6be5f68ba4a709b50282aed02b041e9a6667b4ba2e1574fb74db07150a7d649420aa5715d2c6cc5257e7739c4764f9a6204ccd49717b3ee559f20
7
+ data.tar.gz: 0e7f79e24f8c378a3f718a8b2cbc03ef339c3b927d42c979edaf4558a0352fefbd4f3d34e9ded365158fd5c182662f0db681d917a07b88afe414cf1b7615cdc5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- utm_tracker (1.0.1)
4
+ utm_tracker (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -38,7 +38,9 @@ and then:
38
38
 
39
39
  2. Prepare link into user registration controller:
40
40
 
41
- `$ https://example.com?utm_data[source]=google&utm_data[medium]=cpc&utm_data[campaign]=testcampaign&utm_data[content]={adgroupid}&utm_data[term]={keyword}`
41
+ `$ https://example.com?utm_source=google&utm_medium=cpc&utm_campaign=testcampaign&utm_content={adgroupid}&utm_term={keyword}`
42
+
43
+ Important: gem can woek only with this utm tags!
42
44
 
43
45
  3. Add into ApplicationController next helper for save utm_tags into current_user session:
44
46
  ```ruby
@@ -54,11 +56,11 @@ before_action :get_utm_data
54
56
 
55
57
  Add this callback where you plan to receive advertising traffic.
56
58
 
57
- 5. Into user registration controller or after_sign_in_path_for method, add UtmTracker client current_user object and session[:utm_data], for_example:
59
+ 5. Into user registration controller or after_sign_in_path_for method, add UtmTracker client current_user object and session, for_example:
58
60
  ```ruby
59
61
  def after_sign_in_path_for(resource)
60
62
  generate_utm_tags
61
- something_path
63
+ something_path_for_redirecting # add your own path
62
64
  end
63
65
 
64
66
  def generate_utm_tags
@@ -5,7 +5,13 @@ module UtmTracker
5
5
  protected
6
6
 
7
7
  def get_utm_data
8
- session[:utm_data] ||= params[:utm_data]
8
+ session[:utm_data] = {
9
+ source: params[:utm_source],
10
+ medium: params[:utm_medium],
11
+ content: params[:utm_content],
12
+ campaign: params[:utm_campaign],
13
+ term: params[:utm_term],
14
+ }
9
15
  end
10
16
  end
11
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UtmTracker
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utm_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Levashov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2023-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry