Custom Parameters
Return to Top ^Some games will need to be able to direct-link users with some predefined parameters. This can be used for tracking statistics, inviting players to a specific gaming session, and so on.
These parameters can be encoded in any format (we recommend JSON), and passed via the
NewgroundsAPI_CustomParams request variable.
Your encoded varaibles should be escaped (use escape() in javascript or rawurlencode() in php) to ensure they work correctly.
Example:
If your game is published at http://www.newgrounds.com/portal/view/123456 and you wanted to pass the following parameters with JSON:
Your JSON string would look like this: {"game_id":"abcdefg"}
You would URL encode the above JSON string and pass it to your game like using the following URL:
http://www.newgrounds.com/portal/view/604294?NewgroundsAPI_CustomParams=%7B%22game_id%22%3A%22abcdefg%22%7D