File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,8 @@ var constructor = function () {
9292 reportEvent = true ;
9393 logEvent ( event ) ;
9494 } else if ( event . EventDataType == MessageType . PageView ) {
95- event . EventName = 'Viewed ' + event . EventName ;
9695 reportEvent = true ;
97- logEvent ( event ) ;
96+ logPageView ( event ) ;
9897 } else if (
9998 event . EventDataType == MessageType . Commerce &&
10099 event . ProductAction &&
@@ -299,6 +298,17 @@ var constructor = function () {
299298 }
300299 }
301300
301+ function logPageView ( event ) {
302+ var eventName = 'Viewed ' + event . EventName ;
303+ event . EventAttributes = event . EventAttributes || { } ;
304+
305+ try {
306+ mixpanel . mparticle . track ( eventName , event . EventAttributes ) ;
307+ } catch ( e ) {
308+ return 'Cannot log event on forwarder: ' + name + ': ' + e ;
309+ }
310+ }
311+
302312 function logEvent ( event ) {
303313 event . EventAttributes = event . EventAttributes || { } ;
304314
Original file line number Diff line number Diff line change @@ -91,9 +91,8 @@ var mpMixpanelKit = (function (exports) {
9191 reportEvent = true ;
9292 logEvent ( event ) ;
9393 } else if ( event . EventDataType == MessageType . PageView ) {
94- event . EventName = 'Viewed ' + event . EventName ;
9594 reportEvent = true ;
96- logEvent ( event ) ;
95+ logPageView ( event ) ;
9796 } else if (
9897 event . EventDataType == MessageType . Commerce &&
9998 event . ProductAction &&
@@ -298,6 +297,17 @@ var mpMixpanelKit = (function (exports) {
298297 }
299298 }
300299
300+ function logPageView ( event ) {
301+ var eventName = 'Viewed ' + event . EventName ;
302+ event . EventAttributes = event . EventAttributes || { } ;
303+
304+ try {
305+ mixpanel . mparticle . track ( eventName , event . EventAttributes ) ;
306+ } catch ( e ) {
307+ return 'Cannot log event on forwarder: ' + name + ': ' + e ;
308+ }
309+ }
310+
301311 function logEvent ( event ) {
302312 event . EventAttributes = event . EventAttributes || { } ;
303313
You can’t perform that action at this time.
0 commit comments