chore(client): clean up GA (#40856)
This commit is contained in:
@ -1,29 +0,0 @@
|
|||||||
const isBrowser = typeof window !== 'undefined';
|
|
||||||
|
|
||||||
if (isBrowser) {
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
}
|
|
||||||
|
|
||||||
function gtag() {
|
|
||||||
if (isBrowser) {
|
|
||||||
window.dataLayer.push(arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gtag('js', new Date());
|
|
||||||
gtag('config', 'AW-795617839');
|
|
||||||
|
|
||||||
export function gtagReportConversion(url) {
|
|
||||||
var callback = function() {
|
|
||||||
if (typeof url !== 'undefined' && isBrowser) {
|
|
||||||
window.location = url;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (isBrowser) {
|
|
||||||
gtag('event', 'conversion', {
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
send_to: 'AW-795617839/AmfiCKHHs4gBEK_UsPsC',
|
|
||||||
event_callback: callback
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
@ -8,8 +8,6 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { isSignedInSelector } from '../../../redux';
|
import { isSignedInSelector } from '../../../redux';
|
||||||
import { apiLocation, homeLocation } from '../../../../config/env.json';
|
import { apiLocation, homeLocation } from '../../../../config/env.json';
|
||||||
|
|
||||||
import { gtagReportConversion } from '../../../analytics/gtag';
|
|
||||||
|
|
||||||
import './login.css';
|
import './login.css';
|
||||||
|
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
@ -34,7 +32,6 @@ function Login(props) {
|
|||||||
className={(block ? 'btn-cta-big btn-block' : '') + ' signup-btn btn-cta'}
|
className={(block ? 'btn-cta-big btn-block' : '') + ' signup-btn btn-cta'}
|
||||||
data-test-label={dataTestLabel}
|
data-test-label={dataTestLabel}
|
||||||
href={href}
|
href={href}
|
||||||
onClick={() => gtagReportConversion()}
|
|
||||||
>
|
>
|
||||||
{children || t('buttons.sign-in')}
|
{children || t('buttons.sign-in')}
|
||||||
</Button>
|
</Button>
|
||||||
|
Reference in New Issue
Block a user