Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"history": "^1.17.0",
"html5-uploader": "^0.1.1",
"isomorphic-fetch": "^2.2.1",
"js-cookie": "^2.1.4",
"linkify-it": "^2.0.3",
"lodash": "^4.16.4",
"moment": "^2.14.1",
Expand Down
6 changes: 5 additions & 1 deletion src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,8 @@ export const LS_INCOMPLETE_PROJECT = 'incompleteProject'

export const CONNECT_MESSAGE_API_URL = process.env.CONNECT_MESSAGE_API_URL || TC_API_URL

export const NEW_PROJECT_PATH = '/new-project'
export const NEW_PROJECT_PATH = '/new-project'

// Analytics constants
export const GA_CLICK_ID = '_gclid'
export const GA_CLIENT_ID = '_gacid'
13 changes: 12 additions & 1 deletion src/projects/create/containers/CreateContainer.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import _ from 'lodash'
import Cookies from 'js-cookie'
import React, { PropTypes } from 'react'
import { withRouter, browserHistory } from 'react-router'
import { connect } from 'react-redux'
Expand All @@ -13,7 +14,9 @@ import {
LS_INCOMPLETE_PROJECT,
PROJECT_STATUS_IN_REVIEW,
ACCOUNTS_APP_REGISTER_URL,
NEW_PROJECT_PATH
NEW_PROJECT_PATH,
GA_CLIENT_ID,
GA_CLICK_ID
} from '../../../config/constants'

const page404 = compose(
Expand Down Expand Up @@ -131,6 +134,14 @@ class CreateConainer extends React.Component {
// if user is logged in and has a valid role, create project
// uses dirtyProject from the state as it has the latest changes from the user
// this.props.createProjectAction(project)
const gaClickId = Cookies.get(GA_CLICK_ID)
const gaClientId = Cookies.get(GA_CLIENT_ID)
if(gaClientId || gaClickId) {
const googleAnalytics = {}
googleAnalytics[GA_CLICK_ID] = gaClickId
googleAnalytics[GA_CLIENT_ID] = gaClientId
_.set(project, 'details.utm.google', googleAnalytics)
}
this.props.createProjectAction(project, PROJECT_STATUS_IN_REVIEW)
} else {
// redirect to registration/login page
Expand Down