Gamesalad and Data Analytics
boolsis
Member, PRO Posts: 29
Hello,
I've been searching the web and the forums for an answer, but have not found anything that seems to be "the answer". So, I figured I'd ask. Has anyone been able to set up data analytics for their games?
I'd like to be able to receive data events for installs, engagement, etc. I saw an article re: Tenjin but am not sure if that's the answer.
I also saw this page, which talks about setting up your own server. It seems a bit overwhelming...
Does anyone have any current set-ups that you've found to be useful and somewhat easy to implement?
Thank you!
Comments
I use Amplitude. I created a blog post if you want to try it. You can also use my file if you want as long as you don't produce too many errors.
Wow! This looks pretty straightforward. I'll check it out and let you know if I run into any issues.
A friend recently suggested PubSub but...I spent all of today on it and it feels like I'm either going in the wrong direction, or it's way over my head. He did suggest that I get a backend engineer's help, though... 😂
@adriangomez Just wanted to give a quick update. I have everything set-up in GameSalad and created an account in Amplitude, but for some reason, the callback is returning -1. I'm hosting the file on my website but I guess it can't ping it? I can see the file when I navigate to it via the URL.
I tried using your script on your site and was getting a 0. So it didn't seem to be firing at all, either.
I did have a question: how come you're using "Get URL to Table" instead of "Send Table to URL"? Am I understanding it incorrectly that you'd want to send the data out to the URL?
Update 2: Using your script seemed to have worked now. The event actually showed up in Amplitude. So, it must be the way my file is being hosted on my site. I'll have to find out what's wrong there.
Update 3: I figured out the issue. I don't believe PHP files are allowed on Weebly, where my site (and the file) is being hosted. So, I need to figure out a way to host this PHP script so it fires when it's called.
To answer your only question: We don't want to send anything extra to the URL other than the GET string. If we used send the table to URL we would send additional data that is not needed. An empty table in GameSalad is not 0 bytes.
There are a few other sites you can host javascript code that can pass data on to amplify.
Here's some sample code for parsing the table data and using glitch as a hosts.
https://forums.gamesalad.com/discussion/comment/614627/p1
Some other similar sites:
https://github.com/features/codespaces/
https://pipedream.com/
I set up some actions on PipeDream, which means you can take advantage of that code to parse the requests and then forward that data to Amplitude or one of the their existing integrations.
@adent42 Did you make those actions public on PipeDream? Or do you mean that it is possible to create actions?
@adriangomez i made them public, or at least I think I did:
GameSalad - Post Table Data Success
GameSalad - Parse Table Data
GameSalad - Create Table Response
Looks like they're not there anymore since their update. I'll need to recreate them!
Okay... so I found out how to see them.
1) Once you log in go to "Explore".
2) Scroll down to Public Actions
3) Search for GameSalad
@adent42 @adriangomez Thanks for all the helpful guidance so far! After discovering that I can't host the PHP file on Weebly, I've been trying to find some other site to do so.
I may be searching for the incorrect thing, though, because I have not had any luck. I've tried Joomla, Google Cloud, and AWS (all free tiers). All I ended up with were file storages. I could link to the files and the URLs displayed the script contents, but none of them fired off the script when I triggered a Network Get behavior in GS.
The other thing I have been trying to do is work with Pipedream. I tried to build the script side of @adriangomez 's set-up since I can't find a place to host the file.
I was able to set up a workflow with a trigger to listen for the Get request from GS. Good news is that I am able to send information from GS to Pipedream (Woo!) but have not been able to figure out how to send the information out to Amplitude. I keep ending up with errors (either missing fields or just errors that I cannot digest).
This image is the trigger I set up in Pipedream. As you guys can see, I am able to query the information from the GS behavior. And in the next image, I'm using another node.js block to pull the data then send it out to the URL (or so I'm led to believe). It's not doing what I think it's supposed to do though...
However, I keep ending up with errors. The previous errors were missing required fields. Now, I'm just getting this status 400 error that I have no idea what it's referencing. Have either of you had any luck using Pipedream to send data to Amplitude?
your wish is my....
@adriangomez As always, you are amazing. I didn't even think to add in another node.js module with a separate script. I was assuming that everything was already packaged nicely in the trigger and then could be sent out via the http module.
I just ran this set-up and it worked!
glad it worked. \o/
@adriangomez you are a machine! Great work!
I updated the scripts so that it now pulls region, country, and state (when available) from the IP address in the header. No changes required to the GameSalad side. Just update the script and you should get those values in Amplitude.
Hi @adriangomez I was checking in https://adriangomez.net/2021/03/15/gamasalad-php-amplitude/ and all images are from online creator version of GS, these ideas work too in Mac version? Thanks
I believe they do but I have never tested them. I have been working exclusively on the online creator for a few years now. Although I started with PHP, I have been using the Pipedream script discussed here:
This script has the added advantage of using a library to retrieve the location based on IP.
I haven't watched it in a while, but I think it all should work fine in any version of the tool since I don't think he's hacking the engine like for HTML5 based stuff.