apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Google Analytics WebView Integration #1330

Closed jafg1993 closed 8 months ago

jafg1993 commented 1 year ago

Hi 👋, actually we have a web project on React and include Google TagManager and Google Analytics but when we pass the project to Cordova the data collect from Google Analytics isnt working.

the question is exists a workaround or configuration for this scenario or it's not possible have GTM Web on cordova hybrid app?

breautek commented 1 year ago

Im not too familiar with google analytics but if its like many other google products the api keys have to be tied to a verifiable domain, which doesn't exist in cordova environments because there is no webserver.

They often have native sdks for their products that swaps out that verification strategy with one that makes sense for mobile applications, like tieing to the app bundle id. These verification steps ensures no one else can use your API keys.

So you'll probably need to find (or build) a plugin that interfaces with the native sdk instead of using the web based sdk.

breautek commented 8 months ago

Closing as stale.