Unfortunately that is not enough. As anonymous traffic falls also under GDPR.
This is what most websites do currently in the EU:
Before clicking the switch:
After clicking the switch: