Browser Tracker : Collector URL not hitting

I am following browser-tracker documents to run trackPageView event but I could not able to hit the collector URL. when curl https://snowplow-collector-dev-zxbopxaa2q-an.a.run.app/health is OK
below is the code, can anyone tell me what is the issue?

import { newTracker, trackPageView } from “@snowplow/browser-tracker”;
newTracker(‘sp1’, ‘https://snowplow-collector-dev-zxbopxaa2q-an.a.run.app’, {
appId: ‘my-app-id’,
platform: ‘mob’
})

trackPageView();

Try the endpoint without the protocol in the tracker configuration:

newTracker(‘sp1’, ‘snowplow-collector-dev-zxbopxaa2q-an.a.run.app’, {...

Nothing is screaming out at me as incorrect here. Are there any CORS errors for that endpoint in your developer console, or anyother errors/warnings that look relevant?

I am running on local system via Node js and there are no any error.

Thanks for the reply but I have tried this option by removing http or https protocal but still not hitting the collector url.