File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1- // -*- mode: javascript; js-indent-offset : 2; -*-
1+ // -*- mode: javascript; js-indent-level : 2; -*-
22// Copyright © 2017-2019 Massachusetts Institute of Technology, All rights reserved.
33// Released under the Apache License, Version 2.0
44// http://www.apache.org/licenses/LICENSE-2.0
@@ -295,8 +295,14 @@ $(document).ready(function() {
295295
296296sendAnalyticsEvent = function ( eventObject ) {
297297 if ( document . getElementById ( "hasAnalytics" ) && document . getElementById ( "hasAnalytics" ) . innerHTML === "1" ) {
298- ga ( 'send' , eventObject ) ;
299- //console.log(eventObject);
298+ if ( gtag ) {
299+ try {
300+ var eventAction = eventObject . eventAction || 'custom_event' ;
301+ gtag ( 'event' , eventAction , eventObject ) ;
302+ } catch ( e ) {
303+ // Throwing an error here breaks page transitions.
304+ }
305+ }
300306 }
301307} ;
302308enlargeVideo = function ( youtubeid ) {
You can’t perform that action at this time.
0 commit comments