Angular 5 countly add event

Hello there,
I have integrated countly into angular and it works smoothly.

I want to add a new event by clicking a button as a trial.
sends a request as a result of the transaction, but does not add an event.

 

Html Code

app.compnent.html

<button type="submit"id="asyncTestButton"(click)="clickEvent()">Test Button</button>
 
Typescript Code
 
app.component.ts
 
clickEvent(){

var Countly = Countly || {};

Countly.q = Countly.q || [];

Countly.q.push(['add_event',{

"key": "example",

"count": 1,

"sum": 1.5,

"dur": 30,

"segmentation": {

"key1": "value1",

"key2": "value2"

}

}]);

}

Result

[{"key":"[CLY]_action","count":1,"segmentation":{"type":"click","x":635,"y":226,"width":1665,"height":1221,"domain":"localhost","view":"/"},"hour":11,"dow":1}]

Thanks
1

Comments

4 comments
  • Hi Ziya,

     

    Thanks for reaching out to us. To help us investigate the issue can you please enable debug in SDK and check the logs and see if the requests are successfully going through or not? Thank you.

    0
    Comment actions Permalink
  • Hello Subodh,
    Thank you for your quick reply, as I said, there is no problem in requesting. My request url https://try.count.ly/i?events= starts like this.

    events: [{"key": "[CLY] _action", "count": 1, "segmentation": {"type": "click", "x": 1237, "y": 35, "width": 1665, "height": 1083, "domain", "I ui.dijitaldepo.co", "view", "/"}, "timestamp": 1587451567 "hour" 9 "Dow" 2}]

    Response : result: "Success"

    but the event I want is not included in the events array.

    0
    Comment actions Permalink
  • Hello Ziya,

    Thanks for the update, the next step would be to check Utilities > Request Logs on the server to see if the requests being sent from the SDK arrived or not and if there were any problems processing them. Thank you :)

    0
    Comment actions Permalink
  • Additionally you can follow this article for step by step guide on how to troubleshoot this issue and please let me know if you still need help.

    0
    Comment actions Permalink

Please sign in to leave a comment.