File tree Expand file tree Collapse file tree 2 files changed +0
-21
lines changed
packages/react/src/analytics/integrations Expand file tree Collapse file tree 2 files changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -670,12 +670,6 @@ class GA4 extends integrations.Integration {
670670 * Method that will be called when the GA4 script loads.
671671 */
672672 scriptOnload = ( ) => {
673- if ( ! window . gtag && ! ! this . customLoadScriptFn ) {
674- throw new Error (
675- `${ MESSAGE_PREFIX } ${ INIT_ERROR } Custom load script function finished but 'window.gtag' is not defined.` ,
676- ) ;
677- }
678-
679673 if ( this . initializePromiseResolve ) {
680674 this . initializePromiseResolve ( ) ;
681675 this . initializePromiseResolve = null ;
Original file line number Diff line number Diff line change @@ -150,21 +150,6 @@ describe('GA4 Integration', () => {
150150 ) ;
151151 }
152152 } ) ;
153-
154- it ( 'Should throw if custom script did not instantiate gtag properly' , ( ) => {
155- const options = {
156- ...validOptions ,
157- [ OPTION_LOAD_SCRIPT_FUNCTION ] : ( ) => Promise . resolve ( ) ,
158- } ;
159-
160- try {
161- ga4Instance = createGA4Instance ( options ) ;
162- } catch ( e ) {
163- expect ( e . message ) . toContain (
164- `${ MESSAGE_PREFIX } ${ INIT_ERROR } Custom load script function finished but 'window.gtag' is not defined.` ,
165- ) ;
166- }
167- } ) ;
168153 } ) ;
169154
170155 it ( 'Should throw when tracking event if gtag is not defined' , async ( ) => {
You can’t perform that action at this time.
0 commit comments