How to Track if Payment is Received with API in Coinbase
Use the callback URL, it will load it on the first confirmation.
Just have it load a URL that runs a script to notify you or record the transaction somewhere.
https://coinbase.com/api/doc/1.0/buttons/create.html

Create a payment button
This will create the code for a payment button (and modal window) that you can use to accept bitcoin on your website. You can read more about payment buttons here and try a demo.
The method signature is public function createButton($name, $price, $currency, $custom=null, $options=array()). The custom param will get passed through in callbacks to your site. The list of valid options are described here.