File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
javascript/tokenscript-viewer/src
components/viewers/new/viewer-popover Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,19 @@ export class ViewerPopover {
136136
137137 history . pushState ( undefined , undefined , location ) ;
138138
139+ if ( window . gtag ) {
140+ let data : any = {
141+ tsIdOrUrl : sourceInfo . tsId ?? sourceInfo . sourceUrl
142+ } ;
143+ if ( params . has ( "chain" ) ) {
144+ data . chain = params . get ( "chain" ) ;
145+ data . contract = "evm:" + params . get ( "contract" ) ;
146+ data . scriptId = params . get ( "scriptId" ) ;
147+ }
148+ window . gtag ( 'set' , data ) ;
149+ window . gtag ( 'event' , 'tokenscript_opened' , data ) ;
150+ }
151+
139152 await this . reloadOtherScripts ( ) ;
140153 }
141154
Original file line number Diff line number Diff line change 3434 gtag ( 'config' , 'G-0YTFX5PTEZ' , {
3535 'viewer_type' : query . has ( "viewType" ) ? query . get ( "viewType" ) : "default" ,
3636 'chain' : query . get ( "chain" ) ,
37- 'contract' : query . get ( "contract" ) ,
37+ 'contract' : "evm:" + query . get ( "contract" ) ,
3838 'scriptId' : query . get ( "scriptId" )
3939 } ) ;
4040</ script >
You can’t perform that action at this time.
0 commit comments