Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change event names, track callback url hit and pass callback to twitter.

  • Loading branch information...
commit daaba4117a4cbcfb952e53c9f317d8eb8b97c604 1 parent ecc31a1
@mpereira mpereira authored
View
4 app/controllers/welcome_controller.rb
@@ -36,6 +36,10 @@ def home
@questions = Question.latest.limit(10) || [] if @news_items.empty?
@getting_started = Answer.find_by_id("4d42bebf79de4f262d000e4b")
+ if %w[facebook twitter].include?(params[:shared_url_invitation])
+ track_event("shared_invitation_url_via_#{params[:shared_url_invitation]}".to_sym)
+ end
+
set_tab :all, :welcome_home
render 'home'
end
View
2  app/helpers/application_helper.rb
@@ -383,7 +383,7 @@ def link_to_bing_search(query_string, options = {})
def tweet_button(options)
link_to('',
url_for({ :host => 'twitter.com/share',
- :original_referer => root_url,
+ :original_referer => options[:original_referer],
:source => :tweetbutton,
:text => options[:text],
:url => options[:url] }),
View
5 app/views/welcome/_sidebar.html.haml
@@ -13,7 +13,8 @@
:scope => [:url_invitations,
:share,
:twitter]),
- :url => root_url(:ref => current_user.url_invitation.ref))
+ :url => root_url(:ref => current_user.url_invitation.ref),
+ :original_referer => root_url(:shared_url_invitation => :twitter))
#facebook
= facebook_button(:action => :feed,
:description => t(:description,
@@ -24,7 +25,7 @@
:scope => [:url_invitations,
:share,
:facebook]),
- :redirect_uri => root_url,
+ :redirect_uri => root_url(:shared_url_invitation => :facebook),
:url => root_url(:ref => current_user.url_invitation.ref))
#url_field_wrapper
= url_field_tag(:ref,
View
4 public/javascripts/modules/mixpanel.js
@@ -7,12 +7,12 @@ $(document).ready(function() {
mpq.name_tag(user_name);
$('#url_share #twitter').delegate('a', 'click', function() {
- mpq.track('twitter_share_clicked', properties);
+ mpq.track('clicked_to_share_url_invitation_via_twitter', properties);
mpq.track('any_action', properties);
});
$('#url_share #facebook').delegate('a', 'click', function() {
- mpq.track('facebook_share_clicked', properties);
+ mpq.track('clicked_to_share_url_invitation_via_facebook', properties);
mpq.track('any_action', properties);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.