Despite being one of the weakest dimers in nature, low-spectral-resolution Voyager/IRIS observations revealed the presence of (H$_2$)$_2$ dimers on Jupiter and Saturn in the 1980s. However, the collision-induced H$_2$-H$_2$ opacity databases widely used in planetary science (Borysow et al., 1985; Orton et al., 2007; Richard et al., 2012) have thus far only included free-to-free transitions and have neglected the contributions of dimers. Dimer spectra have both fine-scale structure near the S$(0)$ and S$(1)$ quadrupole lines (354 and 587 cm$^{-1}$, respectively), and broad continuum absorption contributions up to $pm50$ cm$^{-1}$ from the line centres. We develop a new ab initio model for the free-to-bound, bound-to-free and bound-to-bound transitions of the hydrogen dimer for a range of temperatures (40-400 K) and para-hydrogen fractions (0.25-1.0). The model is validated against low-temperature laboratory experiments, and used to simulate the spectra of the giant planets. The new collision-induced opacity database permits high-resolution (0.5-1.0 cm$^{-1}$) spectral modelling of dimer spectra near S$(0)$ and S$(1)$ in both Cassini Composite Infrared Spectrometer (CIRS) observations of Jupiter and Saturn, and in Spitzer Infrared Spectrometer (IRS) observations of Uranus and Neptune for the first time. Furthermore, the model reproduces the dimer signatures observed in Voyager/IRIS data near S$(0)$ (McKellar et al., 1984) on Jupiter and Saturn, and generally lowers the amount of para-H$_2$ (and the extent of disequilibrium) required to reproduce IRIS observations.