Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1947 Plus checkout UTM params #499

Merged
merged 4 commits into from Feb 21, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Prev
Refactor messaging passing
  • Loading branch information
benstrumeyer committed Feb 21, 2020
commit 1f5c6c86acd66a4ce86162399419cce27ce0bcde
@@ -277,7 +277,10 @@ class Stats extends React.Component {
*/
subscribe = () => {
sendMessage('ping', 'hist_plus_cta');
openCheckoutPage('historical_stats');
openCheckoutPage({
utm_source: 'gbe',
utm_campaign: 'in_app_hstats'
});
}

/**
@@ -21,7 +21,10 @@ import { sendMessage, openCheckoutPage } from '../utils/msg';
*/
function _handleBecomeClick() {
sendMessage('ping', 'plus_cta_extension');
openCheckoutPage('plus_panel');
openCheckoutPage({
utm_source: 'gbe',
utm_campaign: 'in_app_plus'
});
}

/**
@@ -124,10 +124,8 @@ export function openSubscriptionPage() {
* This should be used for messages that don't require a callback.
* @memberOf PanelUtils
*/
export function openCheckoutPage(from) {
sendMessage('account.openCheckoutPage', {
from
});
export function openCheckoutPage(utm) {
sendMessage('account.openCheckoutPage', { utm });
window.close();
}

@@ -850,11 +850,9 @@ function onMessageHandler(request, sender, callback) {
}
if (name === 'account.openCheckoutPage') {
let url = `https://checkout.${globals.GHOSTERY_DOMAIN}.com/plus`;
const { from } = message;
if (from === 'historical_stats') {
url += '?utm_source=gbe&utm_campaign=in_app_hstats';
} else if (from === 'plus_panel') {
url += '?utm_source=gbe&utm_campaign=in_app_plus';
const { utm } = message || null;
if (utm) {
url += `?utm_source=${utm.utm_source}&utm_campaign=${utm.utm_campaign}`;
}
utils.openNewTab({ url, become_active: true });
return false;
ProTip! Use n and p to navigate between commits in a pull request.