From 6a7c592632d977adad49954a15c0d727fcee3801 Mon Sep 17 00:00:00 2001 From: joaobisi Date: Tue, 17 Jan 2023 02:16:04 -0300 Subject: [PATCH 1/3] adding utm parameters in the link to the donation page included in the facebook and twitter buttons Co-authored-by: victordscabral Co-authored-by: kayrocesar --- app/javascript/legacy/nonprofits/donate/followup-step.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/legacy/nonprofits/donate/followup-step.js b/app/javascript/legacy/nonprofits/donate/followup-step.js index f1bd69d5f..0079bfdf1 100644 --- a/app/javascript/legacy/nonprofits/donate/followup-step.js +++ b/app/javascript/legacy/nonprofits/donate/followup-step.js @@ -14,7 +14,7 @@ function view(state) { h('a.button--small.facebook.u-width--full.share-button', { props: { target: '_blank' - , href: 'https://www.facebook.com/dialog/feed?app_id='+app.facebook_app_id +"&display=popup&caption=" + encodeURIComponent(app.campaign.name || app.nonprofit.name) + "&link="+window.location.href + , href: 'https://www.facebook.com/dialog/feed?app_id='+app.facebook_app_id +"&display=popup&caption=" + encodeURIComponent(app.campaign.name || app.nonprofit.name) + "&link="+window.location.href + "?/utm_source=facebook&utm_medium=social&utm_campaign=" + encodeURIComponent(app.campaign.name) } }, [h('i.fa.fa-facebook-square'), ` ${I18n.t('nonprofits.donate.followup.share.facebook')}`] ) ]) @@ -22,7 +22,7 @@ function view(state) { h('a.button--small.twitter.u-width--full', { props: { target: '_blank' - , href: "https://twitter.com/intent/tweet?url="+window.location.href+"&via=CommitChange&text=Join me in supporting:" + (app.campaign.name || app.nonprofit.name) + , href: "https://twitter.com/intent/tweet?url="+window.location.href+"&via=CommitChange&text=Join me in supporting:" + (app.campaign.name || app.nonprofit.name) + "?/utm_source=twitter&utm_medium=social&utm_campaign=" + encodeURIComponent(app.campaign.name) } }, [h('i.fa.fa-twitter-square'), ` ${I18n.t('nonprofits.donate.followup.share.twitter')}`] ) ]) From 0ac6c47298a3add103843bd8e5cc5712a391cf19 Mon Sep 17 00:00:00 2001 From: joaobisi Date: Tue, 17 Jan 2023 03:12:38 -0300 Subject: [PATCH 2/3] changing utm medium parameter value to organic social Co-authored-by: victordscabral Co-authored-by: kayrocesar --- app/javascript/legacy/nonprofits/donate/followup-step.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/legacy/nonprofits/donate/followup-step.js b/app/javascript/legacy/nonprofits/donate/followup-step.js index 0079bfdf1..0ed8996cd 100644 --- a/app/javascript/legacy/nonprofits/donate/followup-step.js +++ b/app/javascript/legacy/nonprofits/donate/followup-step.js @@ -14,7 +14,7 @@ function view(state) { h('a.button--small.facebook.u-width--full.share-button', { props: { target: '_blank' - , href: 'https://www.facebook.com/dialog/feed?app_id='+app.facebook_app_id +"&display=popup&caption=" + encodeURIComponent(app.campaign.name || app.nonprofit.name) + "&link="+window.location.href + "?/utm_source=facebook&utm_medium=social&utm_campaign=" + encodeURIComponent(app.campaign.name) + , href: 'https://www.facebook.com/dialog/feed?app_id='+app.facebook_app_id +"&display=popup&caption=" + encodeURIComponent(app.campaign.name || app.nonprofit.name) + "&link="+window.location.href + "?/utm_source=facebook&utm_medium=organic_social&utm_campaign=" + encodeURIComponent(app.campaign.name) } }, [h('i.fa.fa-facebook-square'), ` ${I18n.t('nonprofits.donate.followup.share.facebook')}`] ) ]) @@ -22,7 +22,7 @@ function view(state) { h('a.button--small.twitter.u-width--full', { props: { target: '_blank' - , href: "https://twitter.com/intent/tweet?url="+window.location.href+"&via=CommitChange&text=Join me in supporting:" + (app.campaign.name || app.nonprofit.name) + "?/utm_source=twitter&utm_medium=social&utm_campaign=" + encodeURIComponent(app.campaign.name) + , href: "https://twitter.com/intent/tweet?url="+window.location.href+"&via=CommitChange&text=Join me in supporting:" + (app.campaign.name || app.nonprofit.name) + "?/utm_source=twitter&utm_medium=organic_social&utm_campaign=" + encodeURIComponent(app.campaign.name) } }, [h('i.fa.fa-twitter-square'), ` ${I18n.t('nonprofits.donate.followup.share.twitter')}`] ) ]) From 7c61cc85e90f50aad6c211a7d6c5d3399b437e14 Mon Sep 17 00:00:00 2001 From: joaobisi Date: Thu, 9 Feb 2023 00:54:15 -0300 Subject: [PATCH 3/3] refactoring twitter url to include utm params. could not add utm campaign name yet Co-authored-by: victordscabral Co-authored-by: kayrocesar --- app/javascript/legacy/nonprofits/donate/followup-step.js | 4 ++-- app/views/components/_twitter_link.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/legacy/nonprofits/donate/followup-step.js b/app/javascript/legacy/nonprofits/donate/followup-step.js index 0ed8996cd..f20ef5565 100644 --- a/app/javascript/legacy/nonprofits/donate/followup-step.js +++ b/app/javascript/legacy/nonprofits/donate/followup-step.js @@ -14,7 +14,7 @@ function view(state) { h('a.button--small.facebook.u-width--full.share-button', { props: { target: '_blank' - , href: 'https://www.facebook.com/dialog/feed?app_id='+app.facebook_app_id +"&display=popup&caption=" + encodeURIComponent(app.campaign.name || app.nonprofit.name) + "&link="+window.location.href + "?/utm_source=facebook&utm_medium=organic_social&utm_campaign=" + encodeURIComponent(app.campaign.name) + , href: 'https://www.facebook.com/dialog/feed?app_id='+app.facebook_app_id +"&display=popup&caption=" + encodeURIComponent(app.campaign.name || app.nonprofit.name) + "&link="+window.location.href } }, [h('i.fa.fa-facebook-square'), ` ${I18n.t('nonprofits.donate.followup.share.facebook')}`] ) ]) @@ -22,7 +22,7 @@ function view(state) { h('a.button--small.twitter.u-width--full', { props: { target: '_blank' - , href: "https://twitter.com/intent/tweet?url="+window.location.href+"&via=CommitChange&text=Join me in supporting:" + (app.campaign.name || app.nonprofit.name) + "?/utm_source=twitter&utm_medium=organic_social&utm_campaign=" + encodeURIComponent(app.campaign.name) + , href: "https://twitter.com/intent/tweet?url="+window.location.href+"&via=CommitChange&text=Join me in supporting:" + (app.campaign.name || app.nonprofit.name) } }, [h('i.fa.fa-twitter-square'), ` ${I18n.t('nonprofits.donate.followup.share.twitter')}`] ) ]) diff --git a/app/views/components/_twitter_link.html.erb b/app/views/components/_twitter_link.html.erb index c3b7d92da..2f7c28a67 100644 --- a/app/views/components/_twitter_link.html.erb +++ b/app/views/components/_twitter_link.html.erb @@ -1,3 +1,3 @@ <%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later # Full license explanation at https://github.com/houdiniproject/houdini/blob/main/LICENSE -%> -https://twitter.com/intent/tweet?url=<%= request.base_url + request.fullpath %>&via=CommitChange&text=<%= text %> +https://twitter.com/intent/tweet?url=<%= request.base_url + request.fullpath %>&utm_source=twitter&utm_medium=social&via=CommitChange&text=<%= text %> \ No newline at end of file