The majority of people between 18 and 34 would be willing to let insurance companies dig through their digital data from social media to health devices if it meant lowering their premiums, a survey shows.

In the younger group, 62 percent said they’d be happy for insurers to use third-party data from the likes of Facebook, fitness apps and smart-home devices to lower prices, according to a survey of more than 8,000 consumers globally by Salesforce.com Inc.’s MuleSoft Inc. That drops to 44 percent when the older generations are included.

As consumers share more of their personal data online, governments increased their scrutiny of how it’s collected and used following the harvest of 61 million Facebook users’ accounts by U.K. firm Cambridge Analytica. The European Union’s new privacy law, known as the General Data Protection Rules, took effect on May 25.

Of the older generations, 45 percent of those aged 35-54 are happy to allow insurers broad access to their digital identity, while 27 percent of those 55 and older would do so.

Insurers are investing millions in improving their digital offerings amid growing competition from fintech startups. But that’s a work in progress: 58 percent of the survey’s respondents said that systems don’t work seamlessly for them, with many citing difficulty filling out a form online. And 56 percent said they would switch their insurance provider if digital service is poor.

“Insurers are already struggling to deliver a connected experience,” said Jerome Bugnet, EMEA client architect at MuleSoft. That is happening “before even considering how they bring all these new data sources into the equation.”