File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
app/frontend/javascript/utils/google-analytics Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,12 @@ export function attachDetailsOpenTracker () {
105105 const summary = detailsElement . querySelector ( 'summary' )
106106 if ( detailsElement . open ) {
107107 window . dataLayer . push ( {
108- event : 'details_opened' ,
109- url : window . location ,
110- text : summary . textContent
108+ event : 'event_data' ,
109+ event_data : {
110+ event_name : 'details_opened' ,
111+ url : window . location ,
112+ text : summary . textContent
113+ }
111114 } )
112115 }
113116 } )
Original file line number Diff line number Diff line change @@ -206,9 +206,12 @@ describe('google_tag.mjs', () => {
206206 document . querySelector ( 'details' ) . querySelector ( 'summary' ) . click ( )
207207
208208 expect ( window . dataLayer ) . toContainEqual ( {
209- event : 'details_opened' ,
210- url : document . location ,
211- text : summaryText
209+ event : 'event_data' ,
210+ event_data : {
211+ event_name : 'details_opened' ,
212+ url : document . location ,
213+ text : summaryText
214+ }
212215 } )
213216 } )
214217 } )
You can’t perform that action at this time.
0 commit comments