Consumer advocates from four European countries filed complaints against Alphabet Inc.’s Google, alleging the company violated the European Union’s new data-privacy law with the way it tracks users’ locations.

The groups from the Netherlands, Norway, Sweden and Slovenia referred Google to their national authorities for what the groups say are breaches of the EU’s General Data Protection Regulation.

GDPR,...