If your application uses its own custom WebViewClient, you should not use the extendsWebView helper method. Instead, ensure that the WebtrendsWebViewClient also gets invoked by following these steps:
Modify your custom WebViewClient to extend WebtrendsWebViewClient instead of WebViewClient.
If you are overriding onLoadResource, call super.onLoadResource.
Add WebtrendsMobileLib.js to the content that will be loaded in the WebView. WebtrendsMobileLib.js is delivered as part of the Webtrends Mobile Library for Android.
Use the WebtrendsLib to generate events. In the embedded web content, use the JavaScript helper functions of the webtrendsLib object to generate events through the native app. A JavaScript helper function exists for each of the event helper functions exposed in the native Webtrends SDK. The JavaScript helper functions take the same arguments as the native helper functions.
<html> <head> <scripttype="text/javascript"src="js/WebtrendsMobileLib.js"></script> <scripttype="text/javascript"> function sendButtonClickEvent(){
var eventPath ="/HelloWorld/button/click"; var eventDesc ="HelloWorld Button Click Event"; var eventType ="click"; var customData ={ customKey :"CustomValue" }; webtrendsLib.onButtonClick(eventPath, eventDesc, eventType, customData); } </script> </head> <body> <div> <inputtype="button"onclick="sendButtonClickEvent()"value="Click Me"> </input> </div> </body> </html>