Knowing that your Arduino already communicates with a third-party server, you can take advantage of it and additionally get the IP address of the Arduino device making the GCM
id registration (in PHP you'd do this by using $_SERVER['REMOTE_ADDR']
).
This way you can keep a 1-to-1 identification of a GCM
id and a public IP address to know to which Arduino device to send the signal.
This would need that you implement some timeout process (for instance, implement a keepalive system and if a device doesn't send a POST
request each X time, just remove it from whithin the connected devices). Also, if the same device connects from two different IP addresses, just keep the last one so you're not mixing up.