Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Imagegram

A procedural generation tool that uses images instead of text code. · By zaratustra

Custom URL parameters on itch.io

A topic by Denys Shust created Apr 17, 2024 Views: 147 Replies: 5
Viewing posts 1 to 3

Hello, how did you fixed the issue with custom url params ?
My Unity WebGL game can not read parameters when uploaded to itch.io (

Developer

I didn't :(

Any update on this? Seems like there's no answer anywhere :(

Nope, no updates yet

Actually, I just found a solution! if you put the lines: 

var url = window.location.href
console.log(url);

inside your index.html file, you can see what itch encodes your url as in the Inspect console. Then, you can append your params to the end of that url and run that. Those params can be read as usual from inside your game.

Example:
Doesn't work: https://lysst.itch.io/examplegame?USER_ID=1234&COND=1
Works: https://html-classic.itch.zone/html/11111111/examplegame_build/index.html?USER_ID=1234&COND=1

Things to note here is that the second link will break if you change the file name (perhaps even when changing out the file for one with the same name - haven't tested it) and it plays the game right in the browser, so you dont get the itch formatting.

Cool, will definitely try this approach