This article explains how to block access to some Google accounts and services while allowing access to accounts in the domains in the exception list.
Device should be in 'Proxy-based' Inspection mode.
SSL (Deep) Inspection is Mandatory.
To enable this feature in the GUI:
On FortiOS 5.6 & 6.0:
1) Go to Security Profiles -> Web Filter.
Go to the Proxy Options section.
FortiOS 6.2.x and above:
2) Enable 'Restrict Google account usage to specific domains'.
3) Select the + button and enter the domains that Google can access, for example, www.fortinet.com
When Google services like Gmail is used, only traffic from the domain of www.fortinet.com
can go through. Traffic from other domains is blocked.