0

Why is my countly analytics not recording the event triggers sent through my spring application?

In my spring application I have put the below script in a newly created javascript file named countly.js

<script type='text/javascript'>
  
var Countly = Countly || {};
Countly.q = Countly.q || [];

Countly.app_key = "YOUR_APP_KEY";

Countly.url = "https://yourdomain.com";

Countly.q.push(['track_sessions']);

Countly.q.push(['track_pageview']);

(function() {
var cly = document.createElement('script'); cly.type = 'text/javascript';
cly.async = true;
// Enter URL of script here (see below for other option)
cly.src = 'https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/lib/countly.min.js';
cly.onload = function(){Countly.init()};
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cly, s);
})();
</script>

From a jsp(click.jsp) where I wanted to initiate the countly I have called countly.init method and triggered an event using countly.add_event method.

I have used the correct url for countly and the correct appkey as well. The syntax for init and add_event method is also correct.

Can someone please let me know if there is anything that I'm missing and why is in the analytics not showing the event triggered.

CodeGem
  • 1
  • 2

0 Answers0