Shaving foam is one of my favourite sensory activities. Some younger ones may need a bit more coaxin to get their hands dirty (and some parents too!) once they start it keeps them occupied for a long time.
I usually put a few of her smaller toys in her wagon and ask her to find them. She gets her hands in straight away. This time we used our ice cream cones and sold ice cream to each other. Maybe you can add some food colouring to depict the different flavoured ice creams.
I have a messy zone just for Jana so I don’t mind when she makes a little mess. I usually lay out the plastic sheet for her to sit on and sit her in the middle of the kitchen while I do my cooking. She tends to take her toys out and washed them in the bathroom to see what she found. So there’s a lot of foot prints to and from the kitchen to the bathroom.
Another way you can use foam (especially if you weren’t too keen on the messy bit) is by spraying the foam into a freezer bag. This keeps the mess contained. You can even add a few drops of colour to several bags and let your toddler press and squish the bag to mix the colours around.