If we assign specific profile card or assign custom profile into data source item(not the page item), then will there be profiling happens?
Unfortunately the answer is no.
Profiling only works on the visited items. It doesn't work in the items used in API while browsing the page and it doesn't work on datasources which are used while generating page content.
You can think of running some powershell script which would gather datasources for your pages and update profile keys on page items depending on what's there on datasources, but I don't think there is anything ready online that you could reuse.