Skip to content

Commit

Permalink
removed google tag manager (#4244)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetif authored Jul 28, 2022
1 parent 08a4d2e commit 8c67a0c
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 38 deletions.
3 changes: 1 addition & 2 deletions bin/headers-production.lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ const web = "https://eapd.cms.gov";
const api = "https://eapd-api.cms.gov";
const okta = "https://idm.cms.gov";
const ga = "https://www.google-analytics.com";
const gtm = "https://www.googletagmanager.com";
const fgapi = "https://fonts.googleapis.com";
const fgsta = "https://fonts.gstatic.com";
const utag = "https://tags.tiqcdn.com";

const securityHeaders = {
"Content-Security-Policy": `default-src 'self' 'unsafe-inline'; connect-src ${api} ${okta} ${ga}; child-src ${okta}; frame-ancestors ${okta}; img-src 'self' ${api} ${okta} ${ga}; object-src 'none'; script-src 'self' 'unsafe-inline' ${gtm} ${ga} ${okta} ${utag}; style-src 'self' 'unsafe-inline' ${fgapi}; font-src 'self' data: ${fgsta};`,
"Content-Security-Policy": `default-src 'self' 'unsafe-inline'; connect-src ${api} ${okta} ${ga}; child-src ${okta}; frame-ancestors ${okta}; img-src 'self' ${api} ${okta} ${ga}; object-src 'none'; script-src 'self' 'unsafe-inline' ${ga} ${okta} ${utag}; style-src 'self' 'unsafe-inline' ${fgapi}; font-src 'self' data: ${fgsta};`,
"Strict-Transport-Security": 'max-age=63072000',
"X-Frame-Options": 'deny',
"X-XSS-Protection": '1; mode=block',
Expand Down
3 changes: 1 addition & 2 deletions bin/headers-staging.lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ const web = "https://staging-eapd.cms.gov";
const api = "https://staging-eapd-api.cms.gov";
const okta = "https://impl.idp.idm.cms.gov";
const ga = "https://www.google-analytics.com";
const gtm = "https://www.googletagmanager.com";
const fgapi = "https://fonts.googleapis.com";
const fgsta = "https://fonts.gstatic.com";
const utag = "https://tags.tiqcdn.com";

const securityHeaders = {
"Content-Security-Policy": `default-src 'self' 'unsafe-inline'; connect-src ${api} ${web} ${okta} ${ga}; child-src ${okta}; frame-ancestors ${okta}; img-src 'self' ${api} ${okta} ${ga}; object-src 'none'; script-src 'self' 'unsafe-inline' ${gtm} ${ga} ${okta} ${utag}; style-src 'self' 'unsafe-inline' ${fgapi}; font-src 'self' data: ${fgsta};`,
"Content-Security-Policy": `default-src 'self' 'unsafe-inline'; connect-src ${api} ${web} ${okta} ${ga}; child-src ${okta}; frame-ancestors ${okta}; img-src 'self' ${api} ${okta} ${ga}; object-src 'none'; script-src 'self' 'unsafe-inline' ${ga} ${okta} ${utag}; style-src 'self' 'unsafe-inline' ${fgapi}; font-src 'self' data: ${fgsta};`,
"Strict-Transport-Security": 'max-age=63072000',
"X-Frame-Options": 'deny',
"X-XSS-Protection": '1; mode=block',
Expand Down
1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"react": "17.0.2",
"react-countdown": "2.3.2",
"react-dom": "17.0.2",
"react-gtm-module": "2.0.11",
"react-hook-form": "7.33.1",
"react-redux": "7.2.8",
"react-router": "5.3.3",
Expand Down
10 changes: 0 additions & 10 deletions web/src/containers/ApdApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
useHistory as actualUseHistory,
useLocation as actualUseLocation
} from 'react-router-dom';
import TagManager from 'react-gtm-module';

import Sidebar from '../layout/nav/Sidebar';
import UnexpectedError from '../components/UnexpectedError';
Expand All @@ -31,7 +30,6 @@ const ApdApplication = ({
apdId,
selectApd: dispatchSelectApd,
setApdToSelectOnLoad: dispatchSelectApdOnLoad,
userRole,
useParams,
useHistory,
useLocation
Expand Down Expand Up @@ -79,14 +77,6 @@ const ApdApplication = ({
);
}

TagManager.dataLayer({
dataLayer: {
stateId: place.id,
eAPDIdHash: apdId,
userRole
}
});

return (
<div className="site-body ds-l-container">
<div className="ds-u-margin--0">
Expand Down
7 changes: 0 additions & 7 deletions web/src/containers/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'connected-react-router';
import TagManager from 'react-gtm-module';
import { setLatestActivity } from '../redux/actions/auth';

import App from './App';

// Set up Google Tag Manager
const tagManagerArgs = {
gtmId: 'GTM-M56ZTV4'
};
TagManager.initialize(tagManagerArgs);

const Root = ({ history, store }) => {
// Create listener for location changing to track activity
history.listen(() => {
Expand Down
12 changes: 1 addition & 11 deletions web/src/pages/dashboard/state-dashboard/StateDashboard.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import PropType from 'prop-types';
import React, { Fragment } from 'react';
import { connect } from 'react-redux';
import TagManager from 'react-gtm-module';

import ApdList from './ApdList';
import AffiliationStatus from './AffiliationStatus';
import { getUserStateOrTerritoryStatus } from '../../../redux/selectors/user.selector';
import { AFFILIATION_STATUSES } from '../../../constants';

const StateDashboard = ({ state, role, approvalStatus }) => {
TagManager.dataLayer({
dataLayer: {
stateId: state ? state.id : null,
userRole: role
}
});

const StateDashboard = ({ approvalStatus }) => {
const isApproved = approvalStatus === AFFILIATION_STATUSES.APPROVED;

return (
Expand All @@ -27,8 +19,6 @@ const StateDashboard = ({ state, role, approvalStatus }) => {
};

StateDashboard.propTypes = {
state: PropType.object.isRequired,
role: PropType.string.isRequired,
approvalStatus: PropType.string.isRequired
};

Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15996,11 +15996,6 @@ react-error-boundary@^3.1.0:
dependencies:
"@babel/runtime" "^7.12.5"

react-gtm-module@2.0.11:
version "2.0.11"
resolved "https://registry.yarnpkg.com/react-gtm-module/-/react-gtm-module-2.0.11.tgz#14484dac8257acd93614e347c32da9c5ac524206"
integrity sha512-8gyj4TTxeP7eEyc2QKawEuQoAZdjKvMY4pgWfycGmqGByhs17fR+zEBs0JUDq4US/l+vbTl+6zvUIx27iDo/Vw==

react-hook-form@7.33.1:
version "7.33.1"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.33.1.tgz#8c4410e3420788d3b804d62cc4c142915c2e46d0"
Expand Down

0 comments on commit 8c67a0c

Please sign in to comment.