$EvaluationCloudObject
gives the cloud object containing the code currently being executed.
Details

- If a cloud notebook is opened on the desktop, $EvaluationCloudObject will be the cloud object for that notebook.
- $EvaluationCloudObject gives None for evaluations done in the desktop with no associated cloud object.
Examples
Wolfram Research (2014), $EvaluationCloudObject, Wolfram Language function, https://reference.wolfram.com/language/ref/$EvaluationCloudObject.html (updated 2017).
Text
Wolfram Research (2014), $EvaluationCloudObject, Wolfram Language function, https://reference.wolfram.com/language/ref/$EvaluationCloudObject.html (updated 2017).
CMS
Wolfram Language. 2014. "$EvaluationCloudObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/$EvaluationCloudObject.html.
APA
Wolfram Language. (2014). $EvaluationCloudObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$EvaluationCloudObject.html