Skip to content

Commit 943519f

Browse files
committed
Removed commented legacy @TracKer calls, nil param
1 parent e962ff4 commit 943519f

File tree

6 files changed

+13
-28
lines changed

6 files changed

+13
-28
lines changed

app/controllers/admin/posts_controller.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ def create
3737
#@post = Post.new
3838
case @post.kind
3939
when "reply"
40-
# @tracker.event(category: "Agent: #{current_user.name}", action: "Agent Replied", label: @topic.to_param) #TODO: Need minutes
41-
tracker("Agent: #{current_user.name}", "Agent Replied", @topic.to_param, nil) #TODO: Need minutes
40+
tracker("Agent: #{current_user.name}", "Agent Replied", @topic.to_param) #TODO: Need minutes
4241
when "note"
43-
# @tracker.event(category: "Agent: #{current_user.name}", action: "Agent Posted Note", label: @topic.to_param) #TODO: Need minutes
44-
tracker("Agent: #{current_user.name}", "Agent Posted Note", @topic.to_param, nil) #TODO: Need minutes
42+
tracker("Agent: #{current_user.name}", "Agent Posted Note", @topic.to_param) #TODO: Need minutes
4543
end
4644
render 'admin/topics/show'
4745
}

app/controllers/admin/topics_controller.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,17 @@ def index
5454
topics_raw = topics_raw.where(current_status: @status)
5555
end
5656
@topics = topics_raw.page params[:page]
57-
# @tracker.event(category: "Admin-Nav", action: "Click", label: @status.titleize)
58-
tracker("Admin-Nav", "Click", @status.titleize, nil)
57+
tracker("Admin-Nav", "Click", @status.titleize)
5958
end
6059

6160
def show
6261
@topic = Topic.where(id: params[:id]).first
6362
if @topic.current_status == 'new'
64-
65-
# @tracker.event(category: "Agent: #{current_user.name}", action: "Opened Ticket", label: @topic.to_param, value: @topic.id)
6663
tracker("Agent: #{current_user.name}", "Opened Ticket", @topic.to_param, @topic.id)
6764
@topic.open
6865
end
6966
@posts = @topic.posts.chronologic
7067

71-
#@tracker.event(category: "Agent: #{current_user.name}", action: "Viewed Ticket", label: @topic.to_param, value: @topic.id)
7268
tracker("Agent: #{current_user.name}", "Viewed Ticket", @topic.to_param, @topic.id)
7369
fetch_counts
7470
end
@@ -122,9 +118,7 @@ def create
122118
UserMailer.new_user(@user, @token).deliver_later
123119

124120
# track event in GA
125-
# @tracker.event(category: 'Request', action: 'Post', label: 'New Topic')
126121
tracker('Request', 'Post', 'New Topic')
127-
# @tracker.event(category: 'Agent: Unassigned', action: 'New', label: @topic.to_param)
128122
tracker('Agent: Unassigned', 'New', @topic.to_param)
129123

130124
format.js {
@@ -166,8 +160,7 @@ def update_topic
166160
@action_performed = "Marked #{params[:change_status].titleize}"
167161
end
168162

169-
# Calls to GA for close, reopen, assigned. Inline version of tracker commented
170-
# @tracker.event(category: "Agent: #{current_user.name}", action: @action_performed, label: @topic.to_param, value: @minutes)
163+
# Calls to GA for close, reopen, assigned.
171164
tracker("Agent: #{current_user.name}", @action_performed, @topic.to_param, @minutes)
172165
end
173166
@posts = @topic.posts.chronologic
@@ -205,7 +198,6 @@ def assign_agent
205198
@topic.assign(previous_assigned_id, assigned_user.id)
206199

207200
# Calls to GA
208-
#@tracker.event(category: "Agent: #{current_user.name}", action: "Assigned to #{assigned_user.name.titleize}", label: @topic.to_param, value: @minutes)
209201
tracker("Agent: #{current_user.name}", "Assigned to #{assigned_user.name.titleize}", @topic.to_param, @minutes)
210202
end
211203
@count = @count + 1

app/controllers/admin/users_controller.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ def show
6161

6262
# We still have to grab the first topic for the user to use the same user partial
6363
@topic = Topic.where(user_id: @user.id).first
64-
# @tracker.event(category: "Agent: #{current_user.name}", action: "Viewed User Profile", label: @user.name)
65-
tracker("Agent: #{current_user.name}", "Viewed User Profile", @user.name, nil)
64+
tracker("Agent: #{current_user.name}", "Viewed User Profile", @user.name)
6665
render 'admin/topics/index'
6766
end
6867

6968
def edit
7069
@user = User.where(id: params[:id]).first
71-
# @tracker.event(category: "Agent: #{current_user.name}", action: "Editing User Profile", label: @user.name)
72-
tracker("Agent: #{current_user.name}", "Editing User Profile", @user.name, nil)
70+
tracker("Agent: #{current_user.name}", "Editing User Profile", @user.name)
7371
end
7472

7573
def update
@@ -82,8 +80,7 @@ def update
8280

8381
@topics = @user.topics.page params[:page]
8482
@topic = Topic.where(user_id: @user.id).first
85-
# @tracker.event(category: "Agent: #{current_user.name}", action: "Edited User Profile", label: @user.name)
86-
tracker("Agent: #{current_user.name}", "Edited User Profile", @user.name, nil)
83+
tracker("Agent: #{current_user.name}", "Edited User Profile", @user.name)
8784

8885
# TODO: Refactor this to use an index method/view on the users model
8986
render 'admin/topics/index'

app/controllers/posts_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def create
5151
@posts = @topic.posts.ispublic.chronologic.active
5252
unless @topic.assigned_user_id.nil?
5353
agent = User.find(@topic.assigned_user_id)
54-
# @tracker.event(category: "Agent: #{agent.name}", action: "User Replied", label: @topic.to_param) #TODO: Need minutes
55-
tracker("Agent: #{agent.name}", "User Replied", @topic.to_param, nil) #TODO: Need minutes
54+
tracker("Agent: #{agent.name}", "User Replied", @topic.to_param) #TODO: Need minutes
5655
end
5756
}
5857
else

app/controllers/topics_controller.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@ def create
145145
end
146146

147147
# track event in GA
148-
# @tracker.event(category: 'Request', action: 'Post', label: 'New Topic')
149148
tracker('Request', 'Post', 'New Topic')
150-
# @tracker.event(category: 'Agent: Unassigned', action: 'New', label: @topic.to_param)
151149
tracker('Agent: Unassigned', 'New', @topic.to_param)
152150

153151
if @topic.private?

lib/email_processor.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ class EmailProcessor
22

33
def initialize(email)
44
@email = email
5-
Rails.logger.info @email
6-
Rails.logger.info "Tracking GA: #{Settings.google_analytics_id}"
7-
8-
@tracker = Staccato.tracker(Settings.google_analytics_id)
5+
@tracker = Staccato.tracker(AppSettings['settings.google_analytics_id'])
96
end
107

118
def process
@@ -49,6 +46,10 @@ def process
4946
# Push array of attachments and send to Cloudinary
5047
handle_attachments(@email, post)
5148

49+
# Call to GA
50+
@tracker.event(category: "Email", action: "Inbound", label: "Forwarded New Topic", non_interactive: true)
51+
@tracker.event(category: "Agent: Unassigned", action: "Forwarded New", label: topic.to_param)
52+
5253
else # this is a new direct message
5354

5455
topic = Forum.first.topics.create(:name => subject, :user_id => @user.id, :private => true)

0 commit comments

Comments
 (0)