As far as I know, international students can't work off-campus in the USA (according to the law). What about Google AdSense?
I have been working on my personal websites and I have activated AdSense on these websites. I have been getting paid in my native country and Google sends the payment to my local bank account.
Could I link my US bank account after I reach there? Will it be considered as off-campus job?
If you are structuring your royalties through a foreign bank in a way to avoid paying American taxes, then from the USCIS/IRS perspective, that would of course be a big big no-no.
As to whether you are permitted or not to receive royalties under your visa, you should ask your international student/scholar's office. It may depend on the degree to which your royalty payment is considered a passive or active activity, or whether it is related to your work as a scholar. You shouldn't do this without consulting the international student's office or an immigration lawyer.