Just a few weeks after the Facebook Inc. (FB) - Get Report Cambridge Analytica data licensing scandal, tech companies are readying for another round of intense focus on user information.

The General Data Production Regulation (GDPR) goes into effect in Europe on May 25. The law is aimed at providing more protection and control for European Union citizens' personal data and better regulating how tech firms use that information. The law will affect any company providing services to people in the bloc, meaning U.S.-based firms will have to comply.

For Facebook and Alphabet Inc. (GOOGL) - Get Report , the regulations could potentially mean a hit to advertising revenue, Goldman Sachs analysts wrote in a note on Monday, April 9. Per their forecasts, Alphabet's net advertising revenue could shrink between zero and 2% following the enactment of GDPR "given [analysts'] view that Search is largely protected as it relies less on user data to generate advertisements."

Facebook could see a negative impact of up to 7%, Goldman wrote, "though [analysts] highlight that this impact could be negated completely if it successfully obtains user consent for processing personal data."

According to Goldman, that looks likely. "We believe both companies are well positioned to obtain consent, given direct relationships with users," analysts wrote, "though we believe Alphabet remains the better positioned of the two to minimize impact."

GDPR requires that advertising businesses either demonstrate legitimate interest in processing user data or secure permission from the user to process the data, Goldman said. It also allows users to opt to be forgotten.

Facebook and Google frequently updated their terms of service, suggesting users are used to periodic prompts from the companies about policy or permission changes. Because of that, Goldman said, the two firms are likely to utilize a similar prompt to gain user permission for data processing. "We acknowledge that the prompt would have to include more clear language and specific disclosure than a normal [terms of service] update, but we believe the companies would not have to incur any material expense to execute such a campaign."

Google's search business is "particularly well insulated," Goldman said, as users aren't required to log in to use the service and ads are based more on search keywords than they are on individual user information. Search represents about 76% of net advertising revenue, analysts estimated. To see the negative 2% impact on advertising revenue analysts predict in the worst case, monetizable inventory in the form of paid clicks and views would have to fall by 10% and pricing would have to fall by 20%.

Facebook earned 24% of its 2017 revenue in Europe. According to Goldman, "Given the highly engaged user base and lack of what we would consider a viable alternative social network, we believe Facebook is likely to be successful in obtaining informed consent from the vast majority of its users in the EU."

But given its recent data scandal, Facebook could face obstacles in convincing users to opt in. The real threat to ad revenue would be a decline in users or total time spent on the platform in Europe. A 10% decline in total time spent on Facebook in Europe and a 20% decline in pricing would lead to a 6.8% drop in ad revenue, analysts found.

Facebook and Alphabet are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells the stocks? Learn more now.