How do I use on construct 2?

0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • How do I use on construct 2?

    They have a REST API.:

    Has anyone manage to use this on a construct 2 project?

  • AJAX the API

  • gumshoe2029 I don't understand. If you managed to implement it successfully, can you post an example? Thanks

  • POST /v2/<game_key>/init HTTP/1.1
    Authorization: <authorization_hash>
    Content-Type: application/json
    {"platform":"ios","os_version":"ios 8.1","sdk_version":"rest api v2"}[/code:1u71vv7d]
    This is the init message I should send.
    I tried with this setup as in the image but it doesn't work.
    Any suggestions?
  • Oops, sorry for the super late reply. I overloaded my feed thing. -- 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.

  • gumshoe2029

    1. You don't have to sign in to see their API. The link is posted in my first post here:

    2. As you see in the later posts I tried to use the AJAX plugin to send post messages but with no success.

  • I have no experience in ajax but you can try:

    Tag: "a"

    URL: ""

    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.

  • No. it doesn't work .

  • Ok,

    [quote:2x5vsb5g]Do not use production keys on the sandbox-api; it will only authorize the sandbox game keys.


    API endpoint for production


    API endpoint for sandbox

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

    After that, i recommend you to try the python example on ... on-example

    Change the line 40-to-45 like:

    # sandbox game keys
    game_key = "your_game_key"
    secret_key = "your_game_secret_key"
    # sandbox API urls
    url_init = '' + game_key + '/init'
    url_events = '' + 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.
  • This is just the init message. Did you made a test with your keys and it works?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you made a test can you post the capx file here? Thanks

  • The python example does more than te init call:

    [quote:35ahbns9]make an init call

    check if disabled

    calculate client timestamp offset from server

    start a session

    add a user event (session start) to queue

    add a business event + some design events to queue

    submit events in queue

    add some design events to queue

    add session_end event to queue

    submit events in queue

    I try using my own keys and it´s seems to work:

    You need to enter your GameAnalytics admin panel and skip the guide to view your gamedata:

  • If you made a test can you post the capx file here? Thanks

    I will continue working, trying to recreate the same phyton example with the construct ajax object and when i get it working, I will publish here the .capx.

  • Hi there,

    Just to let you know GameAnalytics has just released an official GameAnalytics Construct 2 which can be downloaded from here: and there is also documentation on how to use it here:

    Hope it can become useful for you.



    Lead SDK Developer GameAnalytics

  • There is a problem with this plugin. It seams that when you try to add an action the texts are disappearing..

    EDIT: also the plugin throws an error and is unusable

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)