Late reply, but I just came across this template and ran into the same issue as you with itch not being able to detect the canvas size.
But the good news is I found the solution.
Near the bottom of the index.html included in the template, change the line with
<div id="gameContainer">
to
<div id="gameContainer" style="width: %UNITY_WIDTH%px; height: %UNITY_HEIGHT%px"></div>
and itch.io will then be able to automatically find the canvas size.