The European Comission has published a series of guides on research ethics that you can read here: 

Furthermore, the Social Media Research: A Guide to Ethics contains very useful information for those interested in collecting data from social media. However, please note that this guide predates the General Data Protection Regulation