This document proposes a framework for intelligently placing datacenters to optimize response time, availability, costs and emissions. It defines relevant parameters like costs, response time, consistency delay and availability. It formulates the placement problem as an optimization problem aiming to minimize costs while meeting constraints. The problem is solved using simulated annealing and linear programming. A tool is developed to automatically select datacenter locations based on this approach. Experimental results demonstrate millions of dollars can be saved through optimized placement.