This is the core problem, but it's also very difficult to solve.
Google makes money in Europe by selling advertising to European customers. It moves money out tax-free by claiming that much of its income is used to pay for the worldwide tech infrastructure and brand usage to its parent company.
But this is not entirely fictional. To run its business in EU, the local branches do need the infrastructure and Google brand, and paying for it is a valid business expense. The problem is calculating a realistic price for it. How much does Google UK benefit from the "dinosaur game" in Chrome, or how much should the Google Germany share of its development cost be?
Coming up with a fair and loophole-free formula seems impossible. It might be easier to just put a lower tax on revenue than a higher tax on profit.