In ultrarelativistic heavy-ion collisions, the event-by-event variation of the elliptic flow $v_2$ reflects fluctuations in the shape of the initial state of the system. This allows to select events with the same centrality but different initial geometry. This selection technique, Event Shape Engineering, has been used in the analysis of charge-dependent two- and three-particle correlations in Pb-Pb collisions at $\snn =2.76$ TeV. The two-particle correlator $\langle \cos(\varphi_\alpha - \varphi_\beta) \rangle$, calculated for different combinations of charges $\alpha$ and $\beta$, is almost independent of $v_2$ (for a given centrality), while the three-particle correlator $\langle \cos(\varphi_\alpha + \varphi_\beta - 2\Psi_2) \rangle$ scales almost linearly both with the event $v_2$ and charged-particle pseudorapidity density. The charge dependence of the three-particle correlator is often interpreted as evidence for the Chiral Magnetic Effect (CME), a parity violating effect of the strong interaction. However, its measured dependence on $v_2$ points to a large non-CME contribution to the correlator. Comparing the results with Monte Carlo calculations including a magnetic field due to the spectators, the upper limit of the CME signal contribution to the three-particle correlator in the 10-50% centrality interval is found to be 26-33% at 95% confidence level.