From "The Electron" by J. J. Thomson, published in The Scientific Monthly Vol. 20, No. 2 (Feb., 1925), pp. 113-115 https://www.jstor.org/stable/7115
[Continued discussion] previously determined $e/mv^2$, so that when we know $v$ we can find $e/m$. This was found to be equal to $1.8×107$.
Now if $E$ is the charge of electricity carried by the hydrogen atom in the electrolysis of solutions, and $M$ the mass of that atom, $E/M$ can be determined by measuring the quantity of hydrogen liberated when a known quantity of electricity passes through an aqueous solution. This was done long ago, and the result was that $E/M=104$. Special investigations have shown that $e$, the charge on the electron, is equal to $E$, the charge on the hydrogen ion ; hence since $e=E$ and $e/m=1.8×107$, while $E/M=104$, $m=M/1800$ or the mass of an electron is only $1/1800$ of that of an atom of hydrogen.
What kind of investigation let Thomson decide that charge on hydrogen ion $E$ is equal to charge on an electron $e$ where the charge of electron was itself not known?
How did he even decided that negative charge is quantised? Cause his experiments only tell that ratio of charge with mass is constant. Then how he decided first electron is quantised and its charge same in magnitude as on hydrogen ion?