For simple shapes as these you can use angle difference and knee values to get at a good guess of the shape.
For all shapes you record all the points in a stroke (or merge all strokes into a path for one session).
For a square you go line by line (previous point and current point) to calculate the angle between them. If an angle is above a threshold (f.ex. 50 degrees) then you have a corner. If you end up with three corners and the end point close to the start point then you likely have a square. Also consider to weight position in relation to the whole drawing area.
For circles you weight the average angle of all lines. They would all go in one direction +/- some degrees. And as with squares check the end point if it is in the "area" of the start point.
The current version of the post states: "the shapes are square, circle, square." - If I assume the last should be triangle, the process is the same as with squares, just count 2 corners at a more steep angle.
You can use smoothing algorithms, moving average, point reduction algorithms and so forth to deal with simpler data. It's in the end all about statistics and probability.
(it's a broad topic so I am a bit reluctant to produce code for this, but I hope the theory contributes to understanding).
Code for calculating angles (x1, y1 being current point, x2 and y2 previous point):
var ang = Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI;
(and you can do all these calculations in vanilla JavaScript btw).