SAN FRANCISCO — It happened to Fitbit. Zynga. Alibaba. Even Brooklyn-based Etsy.

After the hurrahs died down from their initial public offerings, the companies’ stock price dropped and an inevitable wave of securities class actions followed. Then came a tug-of-war over whether the cases should proceed in federal or state court in California.