chore: Port over mission statement and gtag (#34262)
- [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md). - [x] My pull request has a descriptive title (not a vague title like `Update index.md`) - [x] My pull request targets the `master` branch of freeCodeCamp. Closes #18184
This commit is contained in:
committed by
mrugesh mohapatra
parent
4a59a669e3
commit
dbfab5b118
29
client/src/analytics/gtag.js
Normal file
29
client/src/analytics/gtag.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -6,6 +6,8 @@ import { Button } from '@freecodecamp/react-bootstrap';
|
|||||||
import { hardGoTo } from '../../../redux';
|
import { hardGoTo } from '../../../redux';
|
||||||
import { apiLocation } from '../../../../config/env.json';
|
import { apiLocation } from '../../../../config/env.json';
|
||||||
|
|
||||||
|
import { gtagReportConversion } from '../../../analytics/gtag';
|
||||||
|
|
||||||
import './login.css';
|
import './login.css';
|
||||||
|
|
||||||
const mapStateToProps = () => ({});
|
const mapStateToProps = () => ({});
|
||||||
@ -15,6 +17,7 @@ const mapDispatchToProps = dispatch => ({
|
|||||||
|
|
||||||
const createOnClick = navigate => e => {
|
const createOnClick = navigate => e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
gtagReportConversion();
|
||||||
return navigate(`${apiLocation}/signin`);
|
return navigate(`${apiLocation}/signin`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@ import favicons from './favicons';
|
|||||||
import meta from './meta';
|
import meta from './meta';
|
||||||
import mathjax from './mathjax';
|
import mathjax from './mathjax';
|
||||||
import sassjs from './sassjs';
|
import sassjs from './sassjs';
|
||||||
|
import scripts from './scripts';
|
||||||
|
|
||||||
const metaAndStyleSheets = meta
|
const metaAndStyleSheets = meta
|
||||||
.concat(favicons, mathjax, sassjs)
|
.concat(favicons, mathjax, sassjs, scripts)
|
||||||
.map((element, i) => ({
|
.map((element, i) => ({
|
||||||
...element,
|
...element,
|
||||||
key: `meta-stylesheet-${i}`,
|
key: `meta-stylesheet-${i}`,
|
||||||
|
10
client/src/head/scripts.js
Normal file
10
client/src/head/scripts.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const scripts = [
|
||||||
|
<script
|
||||||
|
async=''
|
||||||
|
src='https://www.googletagmanager.com/gtag/js?id=AW-795617839'
|
||||||
|
/>
|
||||||
|
];
|
||||||
|
|
||||||
|
export default scripts;
|
@ -52,7 +52,9 @@
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
.underlined-link {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
@media (min-width: 991px) and (max-width: 1199px) {
|
@media (min-width: 991px) and (max-width: 1199px) {
|
||||||
.testimonial-copy {
|
.testimonial-copy {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
|
@ -88,7 +88,7 @@ const IndexPage = () => (
|
|||||||
<Spacer />
|
<Spacer />
|
||||||
<h2>As featured in:</h2>
|
<h2>As featured in:</h2>
|
||||||
<Image
|
<Image
|
||||||
alt="companies featuring freeCodeCamp"
|
alt='companies featuring freeCodeCamp'
|
||||||
className='img-center'
|
className='img-center'
|
||||||
responsive={true}
|
responsive={true}
|
||||||
src='https://s3.amazonaws.com/freecodecamp/as-seen-on.png'
|
src='https://s3.amazonaws.com/freecodecamp/as-seen-on.png'
|
||||||
@ -212,7 +212,32 @@ const IndexPage = () => (
|
|||||||
<h2 className='black-text'>D3.js</h2>
|
<h2 className='black-text'>D3.js</h2>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<hr />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
|
<h3>
|
||||||
|
freeCodeCamp is a donor-supported tax-exempt 501(c)(3) nonprofit
|
||||||
|
organization (United States Federal Tax Identification Number:
|
||||||
|
82-0779546)
|
||||||
|
</h3>
|
||||||
|
<p className='large-p'>
|
||||||
|
Our mission: to help people learn to code for free. We accomplish this
|
||||||
|
by creating thousands of videos, articles, and interactive coding
|
||||||
|
lessons - all freely available to the public. We also have thousands of
|
||||||
|
freeCodeCamp study groups around the world.
|
||||||
|
</p>
|
||||||
|
<p className='large-p'>
|
||||||
|
Donations to freeCodeCamp go toward our education initiatives, and help
|
||||||
|
pay for servers, services, and staff. You can{' '}
|
||||||
|
<a
|
||||||
|
className='large-p underlined-link'
|
||||||
|
href='https://donate.freecodecamp.org/'
|
||||||
|
rel='noopener noreferrer'
|
||||||
|
target='_blank'
|
||||||
|
>
|
||||||
|
make a tax-deductible donation here
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
.<Spacer />
|
||||||
<BigCallToAction />
|
<BigCallToAction />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
|
Reference in New Issue
Block a user