Hi, I want to send properties for the user session and send custom errors from my Ionic mobile application. I installed the @dynatrace/cordova-plugin but when implementing dtrum it tells me that it is not defined. That's why I can't use the dtrum.identifyUser() or the dtrum.reportCustomError(). Any suggestions for this?
Thanks
Solved! Go to Solution.
Hi @gus_solji, please don't forget this step:
Select Download dynatrace.config.js, and add the downloaded file to the root of your Cordova app workspace next to the config.xml file.
Hi Daniel, thanks for the answer.
I have the dynatrace.config.js file in the root. My ionic app is with capacitor. Is something different needed to use dtrum?
When I run the app I get this error
The error means that dtrum is not available for some reason. If you have the .js file installed can you check if you have connectivity to the url listed there.
example:
js : {
url : "https://www.com.com:9999/e/esdeds-1059-4728-8d5e-f30819dbc4cc/api/v1/rum/jsInlineScript/APPLICATION-...",
},
Thanks again for your help Daniel,
I checked the file and yes I have this configuration.:
great, so can you try using a curl if you have connectivity to that url?
Hi Daniel,
Could you give me an example of curl to be able to do it?
Thanks
yes, curl -X GET "https://dynatrace.com/api/v1/rum/jsInlineScript/APPLICATION-example?Api-Token=example" -H "accept: */*" -H "Authorization: Api-Token 123456"
You can change URL and API TOKEN with yours.
thanks, I got this
I'm sure I have some error writing the curl but I don't know which one. When I write the url in the browser I get back the js script
my mistake, sorry, I edited the curl I send you one more pair of "
Thanks Daniel now dtrum is working at least now is define in the app but I don't see the information in the dynatrace application. I used this function dtrum.identifyUser("email) and dtrum.reportCustomError("home", "Errro in home") but I don't see the information in the dynatrace application. Any idea?
thanks
your welcome, just to be sure, the percentage of sessions is at 100%?
Yes the percentage is 100%
I know I am sending information because dtrum is already defined and I am using console log to be able to see certain responses such as dtrum.sendSessionProperties(). But I can't see the information in dynatrace.
and for custom errors the config is Any key and value?
Also, please have a look at this my guess is that you have problems with the beacon. Because everything else seems ok. And please check your firewall settings with this. Your firewall could be ripping off headers.
Your Dynatrace config seems ok, for me it is an external problem.
The cors is not enabled for my mobile app. It is working now.
Thanks for all the help Daniel
Hi, I need to send custom errors and identify the user session in a mobile application with ionic and capacitor. To use Dtrum just add the dynatrace.config.js file in the root of the project?
root of the project? and install @dynatrace/cordova-plugin?
Or do I need to do some extra step?
thanks