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 all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -1936,7 +1936,7 @@
"content": "</a>"
},
"link_start": {
"content": "<br><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.ghostery.com/products/plus/\">"
"content": "<br><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.ghostery.com/products/plus?utm_source=gbe&utm_campaign=in_app_hstats_lm\">"
}
}
},
@@ -29,7 +29,7 @@ class PlusView extends Component {
*/
_renderButton = (additionalClasses) => {
const { isPlus, onPlusClick } = this.props;
const buttonHref = `https://checkout.${globals.GHOSTERY_DOMAIN}.com/plus`;
const buttonHref = `https://checkout.${globals.GHOSTERY_DOMAIN}.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus`;
const buttonClassNames = ClassNames('PlusView__button', 'button', additionalClasses, {
disabled: isPlus,
});
@@ -70,7 +70,7 @@ describe('app/hub/Views/PlusView component', () => {
component.find('.PlusView__button').first().simulate('click');
expect(initialState.onPlusClick.mock.calls.length).toBe(1);

expect(component.find('.PlusView__button').first().props().href).toBe('https://checkout.ghosterystage.com/plus')
expect(component.find('.PlusView__button').first().props().href).toBe('https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus')

expect(component.find('.PlusView__button').length).toBe(8);
expect(component.find('.PlusView__button.disabled').length).toBe(0);
@@ -361,7 +361,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
>
<a
className="PlusView__button button"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -468,7 +468,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
</div>
<a
className="PlusView__button button show-for-large"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -497,7 +497,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
/>
<a
className="PlusView__button button PlusView--addSideMargin"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -540,7 +540,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
</div>
<a
className="PlusView__button button show-for-large"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -569,7 +569,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
/>
<a
className="PlusView__button button PlusView--addSideMargin"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -603,7 +603,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
</div>
<a
className="PlusView__button button show-for-large"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -632,7 +632,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
/>
<a
className="PlusView__button button PlusView--addSideMargin"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -682,7 +682,7 @@ exports[`app/hub/Views/PlusView component Snapshot tests with react-test-rendere
/>
<a
className="PlusView__button button PlusView--addSideMargin"
href="https://checkout.ghosterystage.com/plus"
href="https://checkout.ghosterystage.com/plus?utm_source=gbe&utm_campaign=intro_hub_plus"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
@@ -277,7 +277,10 @@ class Stats extends React.Component {
*/
subscribe = () => {
sendMessage('ping', 'hist_plus_cta');
openCheckoutPage();
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();
openCheckoutPage({
utm_source: 'gbe',
utm_campaign: 'in_app_plus'
});
}

/**
@@ -36,7 +39,7 @@ const Subscribe = (props) => {
<div className="pitch-container">
<span className="pitch-text" dangerouslySetInnerHTML={{ __html: t('subscribe_pitch') }} />
</div>
<PanelToTabLink href="https://www.ghostery.com/products/plus/">
<PanelToTabLink href="https://www.ghostery.com/products/plus?utm_source=gbe&utm_campaign=in_app_plus_lm">
<span className="pitch-learn-more">{t('subscribe_pitch_learn_more')}</span>
</PanelToTabLink>
<div>
@@ -124,8 +124,8 @@ export function openSubscriptionPage() {
* This should be used for messages that don't require a callback.
* @memberOf PanelUtils
*/
export function openCheckoutPage() {
sendMessage('account.openCheckoutPage');
export function openCheckoutPage(utm) {
sendMessage('account.openCheckoutPage', { utm });
window.close();
}

@@ -849,7 +849,12 @@ function onMessageHandler(request, sender, callback) {
return false;
}
if (name === 'account.openCheckoutPage') {
utils.openNewTab({ url: `https://checkout.${globals.GHOSTERY_DOMAIN}.com/plus`, become_active: true });
let url = `https://checkout.${globals.GHOSTERY_DOMAIN}.com/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;
}
if (name === 'account.openSupportPage') {
ProTip! Use n and p to navigate between commits in a pull request.