How do I use gameanalytics.com on construct 2?

Get help using Construct 2

Post » Wed Jan 20, 2016 2:42 pm

How do I use gameanalytics.com on construct 2?

http://www.gameanalytics.com
They have a REST API.: http://apidocs.gameanalytics.com/REST.html
Has anyone manage to use this on a construct 2 project?
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Fri Jan 22, 2016 6:25 pm

AJAX the API
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Fri Jan 22, 2016 6:55 pm

@gumshoe2029 I don't understand. If you managed to implement it successfully, can you post an example? Thanks
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Mon Jan 25, 2016 12:15 pm

Code: Select all
POST /v2/<game_key>/init HTTP/1.1
Host: sandbox-api.gameanalytics.com
Authorization: <authorization_hash>
Content-Type: application/json

{"platform":"ios","os_version":"ios 8.1","sdk_version":"rest api v2"}


This is the init message I should send.
I tried with this setup as in the image but it doesn't work.
Image
Any suggestions?
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Sat Jan 30, 2016 4:58 pm

Oops, sorry for the super late reply. I overloaded my feed thing.

http://www.gameanalytics.com/docs/rest-api -- you have to sign in to see their API, then you can use the AJAX object to build GET/POST calls to use their API and responses.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Sat Jan 30, 2016 6:44 pm

@gumshoe2029
1. You don't have to sign in to see their API. The link is posted in my first post here:
http://apidocs.gameanalytics.com/REST.html
2. As you see in the later posts I tried to use the AJAX plugin to send post messages but with no success.
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Mon Feb 01, 2016 12:04 pm

I have no experience in ajax but you can try:

Tag: "a"
URL: "sandbox-api.gameanalytics.com"
Data: "{platform: ios, os_version: ios 8.1, sdk_version: rest api v2}"
Method: "POST /v2/<game_key>/init HTTP/1.1"

Cause i think the issue is on the "data" field.
B
5
S
2
G
1
Posts: 17
Reputation: 573

Post » Mon Feb 01, 2016 12:16 pm

No. it doesn't work .
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Post » Mon Feb 01, 2016 1:33 pm

Ok,

Do not use production keys on the sandbox-api; it will only authorize the sandbox game keys.
Production

API endpoint for production api.gameanalytics.com

Sandbox

API endpoint for sandbox sandbox-api.gameanalytics.com


You need to change the URL to "api.gameanalytics.com" if you want to use your own game_key and secret_key.

After that, i recommend you to try the python example on https://apidocs.gameanalytics.com/REST. ... on-example
Change the line 40-to-45 like:

Code: Select all
# sandbox game keys
game_key = "your_game_key"
secret_key = "your_game_secret_key"

# sandbox API urls
url_init = 'http://api.gameanalytics.com/v2/' + game_key + '/init'
url_events = 'http://api.gameanalytics.com/v2/' + game_key + '/events'



Run the example and you will get something like:


----- GameAnalytics REST V2 Example --------
Gzip enabled!
--------------------------------------------
Init call successful !
Events submitted !
Events submitted !

After that, you need to pass this example to Construct2 AJAX.
B
5
S
2
G
1
Posts: 17
Reputation: 573

Post » Mon Feb 01, 2016 1:37 pm

This is just the init message. Did you made a test with your keys and it works?
B
34
S
8
G
4
Posts: 157
Reputation: 3,781

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests