Sign In Register

How can we help you today?

Start a new topic
Answered

I dont think my cloud code AnalyticsRequest is bring triggered

Hi there, I'm trying to log analytics in my cloud code so I made this generic function to handle it.

function logAnalytic(mKey, mStart, mEnd, mData) {
    
    var mRequest = new SparkRequests.AnalyticsRequest();
    mRequest.key = mKey;
    if (mStart !== null) mRequest.start = mStart;
    if (mEnd !== null) mRequest.end = mEnd;
    if (mData !== null) mRequest.data = mData;
    var response = mRequest.Send();
    
}

The problem is I cant seem to find any logs. When I search for any AnalyticsRequest (even with no additional filters) I cant seem to find any of my logs. Something in my above code must be wrong, yes?


Best Answer
Analytics are not logged in DB collections. They are stored in a Redis Cache and are accessible through the API stream.
You can check out a bit more about that here -> https://docs.gamesparks.com/documentation/analytics/api-stream-analytics.html

 


If that is the function verbatim, I don't see you processing the response at all, so how would you know you don't have anything returned?

Yes it is. The only thing I get from the response is

 

{
      "@class": ".AnalyticsResponse"
}

 

Is the example here not valid anymore? I am still not seeing any of the data I am logging or the event itself. Even the "In use" section when building rules for charts don't display the AnalyiticsRequest function.

no ideas or examples for AnalyticsRequest in cloud code?

Answer
Analytics are not logged in DB collections. They are stored in a Redis Cache and are accessible through the API stream.
You can check out a bit more about that here -> https://docs.gamesparks.com/documentation/analytics/api-stream-analytics.html

 

Login to post a comment