@@ -431,7 +431,7 @@ function eventTracking(){
431431 ga ( 'set' , gaCustomDimensions [ 'eventIntent' ] , eventIntent ) ;
432432 var fileName = filePath . substr ( jQuery ( this ) . attr ( 'href' ) . lastIndexOf ( "/" ) + 1 ) ;
433433 ga ( 'set' , gaCustomDimensions [ 'timestamp' ] , localTimestamp ( ) ) ;
434- ga ( 'send' , 'event' , 'PDF View ' , 'View ' , fileName ) ;
434+ ga ( 'send' , 'event' , 'Download ' , 'PDF ' , fileName ) ;
435435 if ( typeof fbq === 'function' ) { fbq ( 'track' , 'ViewContent' , { content_name : fileName } ) ; }
436436 nv ( 'append' , { 'pdf_view' : fileName } ) ;
437437 } ) ;
@@ -444,7 +444,7 @@ function eventTracking(){
444444 ga ( 'set' , gaCustomMetrics [ 'notableDownloads' ] , 1 ) ;
445445 var linkText = jQuery ( this ) . text ( ) ;
446446 var fileName = filePath . substr ( filePath . lastIndexOf ( "/" ) + 1 ) ;
447- ga ( 'send' , 'event' , 'Notable Download' , 'Download ' , fileName ) ;
447+ ga ( 'send' , 'event' , 'Download' , 'Notable ' , fileName ) ;
448448 if ( typeof fbq === 'function' ) { fbq ( 'track' , 'ViewContent' , { content_name : fileName } ) ; }
449449 nv ( 'append' , { 'notable_download' : fileName } ) ;
450450 }
@@ -482,7 +482,7 @@ function eventTracking(){
482482 var emailAddress = jQuery ( this ) . attr ( 'href' ) . replace ( 'mailto:' , '' ) ;
483483 ga ( 'set' , gaCustomDimensions [ 'contactMethod' ] , 'Mailto' ) ;
484484 ga ( 'set' , gaCustomDimensions [ 'timestamp' ] , localTimestamp ( ) ) ;
485- ga ( 'send' , 'event' , 'Mailto ' , 'Click ' , emailAddress ) ;
485+ ga ( 'send' , 'event' , 'Contact ' , 'Mailto ' , emailAddress ) ;
486486 if ( typeof fbq === 'function' ) { if ( typeof fbq === 'function' ) { fbq ( 'track' , 'Lead' , { content_name : 'Mailto' , } ) ; } }
487487 nv ( 'append' , { 'contact_method' : 'mailto' , 'contacted_email' : emailAddress } ) ;
488488 } ) ;
@@ -494,7 +494,7 @@ function eventTracking(){
494494 var phoneNumber = jQuery ( this ) . attr ( 'href' ) . replace ( 'tel:' , '' ) ;
495495 ga ( 'set' , gaCustomDimensions [ 'contactMethod' ] , 'Click-to-Call' ) ;
496496 ga ( 'set' , gaCustomDimensions [ 'timestamp' ] , localTimestamp ( ) ) ;
497- ga ( 'send' , 'event' , 'Click-to-Call ' , 'Call' , phoneNumber ) ;
497+ ga ( 'send' , 'event' , 'Contact ' , 'Click-to- Call' , phoneNumber ) ;
498498 if ( typeof fbq === 'function' ) { if ( typeof fbq === 'function' ) { fbq ( 'track' , 'Lead' , { content_name : 'Click-to-Call' , } ) ; } }
499499 nv ( 'append' , { 'contact_method' : 'click-to-call' , 'contacted_phone' : phoneNumber } ) ;
500500 } ) ;
@@ -506,7 +506,7 @@ function eventTracking(){
506506 var phoneNumber = jQuery ( this ) . attr ( 'href' ) . replace ( 'sms:+' , '' ) ;
507507 ga ( 'set' , gaCustomDimensions [ 'contactMethod' ] , 'SMS' ) ;
508508 ga ( 'set' , gaCustomDimensions [ 'timestamp' ] , localTimestamp ( ) ) ;
509- ga ( 'send' , 'event' , 'Click-to-Call ' , 'SMS' , phoneNumber ) ;
509+ ga ( 'send' , 'event' , 'Contact ' , 'SMS' , phoneNumber ) ;
510510 if ( typeof fbq === 'function' ) { if ( typeof fbq === 'function' ) { fbq ( 'track' , 'Lead' , { content_name : 'SMS' , } ) ; } }
511511 nv ( 'append' , { 'contact_method' : 'sms' , 'contacted_sms' : phoneNumber } ) ;
512512 } ) ;
@@ -536,13 +536,13 @@ function eventTracking(){
536536 if ( regexPattern . email . test ( emailPhone ) ) {
537537 ga ( 'set' , gaCustomDimensions [ 'contactMethod' ] , 'Mailto' ) ;
538538 ga ( 'set' , gaCustomDimensions [ 'eventIntent' ] , 'Intent' ) ;
539- ga ( 'send' , 'event' , 'Contact' , 'Copied email: ' + emailPhone ) ;
540- nv ( 'append' , { 'contact_method' : 'Email (copied )' , 'contacted_email' : emailPhone } ) ;
539+ ga ( 'send' , 'event' , 'Contact' , 'Email (Copied) ' + emailPhone ) ;
540+ nv ( 'append' , { 'contact_method' : 'Email (Copied )' , 'contacted_email' : emailPhone } ) ;
541541 } else if ( regexPattern . phone . test ( emailPhone ) ) {
542542 ga ( 'set' , gaCustomDimensions [ 'contactMethod' ] , 'Click-to-Call' ) ;
543543 ga ( 'set' , gaCustomDimensions [ 'eventIntent' ] , 'Intent' ) ;
544- ga ( 'send' , 'event' , 'Click-to-Call ' , 'Copied phone: ' + emailPhone ) ;
545- nv ( 'append' , { 'contact_method' : 'Phone (copied )' , 'contacted_phone' : emailPhone } ) ;
544+ ga ( 'send' , 'event' , 'Contact ' , 'Phone (Copied) ' + emailPhone ) ;
545+ nv ( 'append' , { 'contact_method' : 'Phone (Copied )' , 'contacted_phone' : emailPhone } ) ;
546546 }
547547
548548 if ( copyCount < 13 ) {
@@ -1910,6 +1910,21 @@ function conversionTracker(conversionpage){
19101910
19111911//Conditional JS Library Loading
19121912function conditionalJSLoading ( ) {
1913+ //Load the Google Maps API if 'googlemap' class exists
1914+ if ( jQuery ( '.googlemap' ) . length ) {
1915+ if ( typeof google == "undefined" || ! has ( google , 'maps' ) ) { //If the API has not already been called
1916+ jQuery . getScript ( 'https://www.google.com/jsapi?key=' + nebula . site . options . nebula_google_browser_api_key , function ( ) {
1917+ google . load ( 'maps' , '3' , {
1918+ callback : function ( ) {
1919+ jQuery ( document ) . trigger ( 'nebula_google_maps_api_loaded' ) ;
1920+ }
1921+ } ) ;
1922+ } ) . fail ( function ( ) {
1923+ ga ( 'send' , 'event' , 'Error' , 'JS Error' , 'Google Maps JS API script could not be loaded.' , { 'nonInteraction' : true } ) ;
1924+ } ) ;
1925+ }
1926+ }
1927+
19131928 //Only load Chosen library if 'chosen-select' class exists.
19141929 if ( jQuery ( '.chosen-select' ) . length ) {
19151930 jQuery . getScript ( nebula . site . resources . js . chosen ) . done ( function ( ) {
0 commit comments