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
pull/34277/head
Stuart Taylor 2018-11-09 15:51:50 +00:00 committed by mrugesh mohapatra
parent 4a59a669e3
commit dbfab5b118
6 changed files with 73 additions and 3 deletions

View 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;
}

View File

@ -6,6 +6,8 @@ import { Button } from '@freecodecamp/react-bootstrap';
import { hardGoTo } from '../../../redux';
import { apiLocation } from '../../../../config/env.json';
import { gtagReportConversion } from '../../../analytics/gtag';
import './login.css';
const mapStateToProps = () => ({});
@ -15,6 +17,7 @@ const mapDispatchToProps = dispatch => ({
const createOnClick = navigate => e => {
e.preventDefault();
gtagReportConversion();
return navigate(`${apiLocation}/signin`);
};

View File

@ -2,9 +2,10 @@ import favicons from './favicons';
import meta from './meta';
import mathjax from './mathjax';
import sassjs from './sassjs';
import scripts from './scripts';
const metaAndStyleSheets = meta
.concat(favicons, mathjax, sassjs)
.concat(favicons, mathjax, sassjs, scripts)
.map((element, i) => ({
...element,
key: `meta-stylesheet-${i}`,

View 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;

View File

@ -52,7 +52,9 @@
margin-left: 20px;
margin-right: 20px;
}
.underlined-link {
text-decoration: underline;
}
@media (min-width: 991px) and (max-width: 1199px) {
.testimonial-copy {
height: 150px;

View File

@ -88,7 +88,7 @@ const IndexPage = () => (
<Spacer />
<h2>As featured in:</h2>
<Image
alt="companies featuring freeCodeCamp"
alt='companies featuring freeCodeCamp'
className='img-center'
responsive={true}
src='https://s3.amazonaws.com/freecodecamp/as-seen-on.png'
@ -212,7 +212,32 @@ const IndexPage = () => (
<h2 className='black-text'>D3.js</h2>
</Col>
</Row>
<hr />
<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 />
<Spacer />
<Spacer />