File tree Expand file tree Collapse file tree 4 files changed +80
-602
lines changed Expand file tree Collapse file tree 4 files changed +80
-602
lines changed Original file line number Diff line number Diff line change @@ -5,28 +5,9 @@ import Course from './Course'
5
5
import WarningBanner from '../components/WarningBanner'
6
6
import AlertBanner from '../components/AlertBanner'
7
7
import { Helmet } from 'react-helmet'
8
- import { useGoogleAnalytics , useUmConsent } from '@tl-its-umich-edu/react-ga-onetrust-consent'
9
8
10
9
function App ( props ) {
11
- const { user, gaId, cspNonce } = props
12
- const { gaInitialized, gaHandlers } = useGoogleAnalytics ( { googleAnalyticsId : gaId , nonce : cspNonce } )
13
- const { umConsentInitialize, umConsentInitialized } = useUmConsent ( )
14
-
15
- if (
16
- ! umConsentInitialized &&
17
- gaInitialized &&
18
- gaHandlers . onConsentApprove &&
19
- gaHandlers . onConsentReject
20
- ) {
21
- const consentParams = {
22
- developmentMode : false ,
23
- alwaysShow : false ,
24
- onConsentApprove : gaHandlers . onConsentApprove ,
25
- onConsentReject : gaHandlers . onConsentReject ,
26
- } ;
27
- umConsentInitialize ( consentParams )
28
- }
29
-
10
+ const { user } = props
30
11
if ( ! user . isLoggedIn ) {
31
12
if ( user . loginURL === '' ) {
32
13
return ( < WarningBanner > This tool needs to be launched from a Canvas course.</ WarningBanner > )
Original file line number Diff line number Diff line change 28
28
}
29
29
</ style >
30
30
{{ myla_globals|json_script:"myla_globals" }}
31
+ < script >
32
+ window . umConsentManager = {
33
+ googleAnalyticsID : "{{ myla_globals.google_analytics_id }}" ,
34
+ googleAnalyticsCustom :
35
+ {
36
+ streamConfig : {
37
+ cookie_flags : 'SameSite=None; Secure'
38
+ }
39
+ } ,
40
+ externalLinkBlank : true ,
41
+ privacyUrl : false
42
+ } ;
43
+ </ script >
44
+ < script async src ="https://umich.edu/apis/umconsentmanager/consentmanager.js "> </ script >
31
45
</ head >
32
46
< body >
33
47
{% include "su/is_su.html" %}
You can’t perform that action at this time.
0 commit comments