Skip to content

Notifications Analytics #160

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

Merged
merged 33 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8782470
Added Notifications Popup
luizrrodrigues Feb 10, 2020
c8308af
Compiled
luizrrodrigues Feb 10, 2020
c1f70f3
Added dist/prod to allow install package via github url
luizrrodrigues Feb 11, 2020
bfa124c
Notifications Popup Fixes
luizrrodrigues Feb 17, 2020
5ac71ba
Fix tests snapshot
luizrrodrigues Feb 17, 2020
1853b7d
Notifications Listing Page
luizrrodrigues Feb 27, 2020
9b24c41
Updated mock data
luizrrodrigues Mar 2, 2020
5457b4b
Backend Integration + Fixes + Broadcast type
luizrrodrigues Mar 9, 2020
418a7ef
Merge branch 'develop' into notifications
luizrrodrigues Mar 30, 2020
b0dcceb
Added dist to gitignore
luizrrodrigues Mar 30, 2020
f827249
ci: test release npm bump up
sushilshinde Mar 30, 2020
71dd786
Google Analytics tracking
luizrrodrigues Mar 31, 2020
d3a0509
Fix tests
luizrrodrigues Mar 31, 2020
9208d34
Added react-ga to webpack config
luizrrodrigues Mar 31, 2020
aea9f00
Added 'prepare' script to package.json
luizrrodrigues Apr 1, 2020
d52d6a0
Merge branch 'develop' into notifications-analytics
sushilshinde Apr 14, 2020
fa544cd
Removing test dist tag
sushilshinde Apr 14, 2020
7acf22c
Moved GA tracking ID to config file
luizrrodrigues Apr 14, 2020
bdecaa1
Fix clean script to run rimraf locally
luizrrodrigues Apr 15, 2020
74e0342
Fix CircleCI: Added 'npm install' to release job
luizrrodrigues Apr 15, 2020
d0e80ec
adding dist tag
sushilshinde Apr 16, 2020
74e49d6
Test release npm bump up
sushilshinde Apr 16, 2020
b01a6bc
Merge pull request #157 from topcoder-platform/notifications-analytics
sushilshinde Apr 23, 2020
0022348
Bump up test release version to 1000.13.4
sushilshinde Apr 23, 2020
4e2fd09
Adding dist tag
sushilshinde Apr 23, 2020
f428f7f
Remove prepare script from package.json
luizrrodrigues Apr 24, 2020
bf0c152
adding dist tag
sushilshinde Apr 27, 2020
0492a60
Test release npm ver bump up to 1000.13.5
sushilshinde Apr 27, 2020
a04774f
changed test version
sushilshinde Apr 28, 2020
091309b
Merge pull request #158 from topcoder-platform/notifications-analytics
sushilshinde Apr 28, 2020
b438ce2
Removed dist tag
sushilshinde Apr 29, 2020
14035d5
Npm ver bump up for production release to v0.17.0
sushilshinde Apr 29, 2020
b5fb7d0
Removed npm install from release job
luizrrodrigues Apr 29, 2020
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
6 changes: 6 additions & 0 deletions __tests__/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,11 @@ Object {
"delay": [Function],
"formatDuration": [Function],
},
"tracking": Object {
"default": undefined,
"event": [Function],
"init": [Function],
"pageView": [Function],
},
}
`;
3 changes: 2 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"AV_SCAN_SCORER_REVIEW_TYPE_ID": "",
"PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID": "",
"PAGE_SIZE": 50,
"REVIEW_OPPORTUNITY_PAGE_SIZE": 1000
"REVIEW_OPPORTUNITY_PAGE_SIZE": 1000,
"GOOGLE_ANALYTICS_ID": ""
}
3 changes: 2 additions & 1 deletion config/development.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"AV_SCAN_SCORER_REVIEW_TYPE_ID": "68c5a381-c8ab-48af-92a7-7a869a4ee6c3",
"PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID": "52c91e85-745f-4e62-b592-9879a2dfe9fd"
"PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID": "52c91e85-745f-4e62-b592-9879a2dfe9fd",
"GOOGLE_ANALYTICS_ID": "UA-161803421-1"
}
3 changes: 2 additions & 1 deletion config/production.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"AV_SCAN_SCORER_REVIEW_TYPE_ID": "55bbb17d-aac2-45a6-89c3-a8d102863d05",
"PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID": "df51ca7d-fb0a-4147-9569-992fcf5aae48"
"PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID": "df51ca7d-fb0a-4147-9569-992fcf5aae48",
"GOOGLE_ANALYTICS_ID": "UA-6340959-1"
}
1 change: 1 addition & 0 deletions config/webpack/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
'moment-duration-format',
'react',
'react-dom',
'react-ga',
'redux',
'redux-actions',
'isomorphic-fetch',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "0.15.0",
"version": "0.17.0",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand All @@ -44,6 +44,7 @@
"qs": "^6.5.2",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-ga": "^2.7.0",
"react-redux": "^6.0.1",
"redux": "^3.7.2",
"redux-actions": "^2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export { actions } from './actions';
export { services } from './services';

export {
challenge, logger, errors, tc, time, mock, submission,
challenge, logger, errors, tc, time, mock, submission, tracking,
} from './utils';
2 changes: 2 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as mock from './mock';
import * as errors from './errors';
import * as filter from './challenge/filter';
import * as submission from './submission';
import * as tracking from './tracking';

const challenge = {
filter,
Expand All @@ -21,4 +22,5 @@ export {
mock,
errors,
submission,
tracking,
};
47 changes: 47 additions & 0 deletions src/utils/tracking.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* global window */
/* global CONFIG */

import ReactGA from 'react-ga';

const { GOOGLE_ANALYTICS_ID } = CONFIG;
const TRACKING_NAME = 'tracking';

/**
* init - Init Google Analytics tracking
* @param {string} userId
*/
export const init = (userId) => {
ReactGA.initialize([{
trackingId: GOOGLE_ANALYTICS_ID,
gaOptions: {
name: TRACKING_NAME,
userId,
},
}], {
alwaysSendToDefaultTracker: false,
});
};

/**
* pageView - Track page view
*/
export const pageView = () => {
ReactGA.pageview(window.location.pathname
+ window.location.search, [TRACKING_NAME]);
};

/**
* event - Add custom tracking event.
* @param {string} category
* @param {string} action
* @param {string} label
*/
export const event = (category, action, label) => {
ReactGA.event({
category,
action,
label,
}, [TRACKING_NAME]);
};

export default undefined;