'Issue when registering more than 20 events at a time in firebase

I am trying to trigger a firebase web event for about 3000+ users. I put the event log script inside the loop where inside the loop I have considered only 50 users initially. But the issue is only 20 events are been logged after running the script and not 50. Below is the script for instance.

for ($x = 1; $x <= 50; $x++) {


<script type="module">      
import * as firebase from "https://www.gstatic.com/firebasejs/9.6.9/firebase-app.js";
import * as firebases from "https://www.gstatic.com/firebasejs/9.6.9/firebase-analytics.js";
const firebaseConfig = {
  apiKey: "AI***********E",
  authDomain: "******.firebaseapp.com",
  projectId: "*******",
  storageBucket: "*******.appspot.com",
  messagingSenderId: "*********",
  appId: "**********",
  measurementId: "*******"
};
// Initialize Firebase
const app = firebase.initializeApp(firebaseConfig);
const analytics = firebases.getAnalytics(app);
firebases.logEvent(analytics,'test_event');       
}

Note: The script that I added inside the loop is basically called from the function. So inside the loop I call a function and that function has the event script.

So, basically, when I run the above code instead of 50 only 20 events are registered in firebase. Can someone please help me to resolve this since I have been dealing with problem since long and not getting any solution.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source