@@ -9,6 +9,7 @@ define(['underscore'], function (_underscore) {
9
9
return function ( target ) {
10
10
var originalTarget = target . trigger ,
11
11
isAdminAnalyticsEnabled ,
12
+ action = '' ,
12
13
event ;
13
14
14
15
/**
@@ -24,6 +25,8 @@ define(['underscore'], function (_underscore) {
24
25
! _underscore . isUndefined ( window . digitalData ) &&
25
26
! _underscore . isUndefined ( window . _satellite ) ;
26
27
28
+ console . log ( name , args ) ;
29
+
27
30
if ( name . indexOf ( 'readyAfter' ) !== - 1 && isAdminAnalyticsEnabled ) {
28
31
window . digitalData . page . url = window . location . href ;
29
32
window . digitalData . page . attributes = {
@@ -32,13 +35,17 @@ define(['underscore'], function (_underscore) {
32
35
window . _satellite . track ( 'page' ) ;
33
36
}
34
37
38
+ if ( name . indexOf ( 'duplicateAfter' ) !== - 1 ) action = 'duplicate' ;
39
+ if ( name . indexOf ( 'removeAfter' ) !== - 1 ) action = 'remove' ;
40
+ if ( name . indexOf ( 'createAfter' ) !== - 1 ) action = 'create' ;
41
+
35
42
if ( ! _underscore . isUndefined ( args ) && ! _underscore . isUndefined ( args . contentType ) &&
36
- ! _underscore . isUndefined ( args . contentType . config )
43
+ ! _underscore . isUndefined ( args . contentType . config && action !== '' )
37
44
) {
38
45
event = {
39
46
element : args . contentType . config . label ,
40
47
type : args . contentType . config . name ,
41
- action : 'custom- action' ,
48
+ action : action ,
42
49
widget : {
43
50
name : args . contentType . config . form ,
44
51
type : args . contentType . config . menu_section
0 commit comments