Why we need to identify customers
Before you can track any events you need to identify your customers. When using our javascript library we make it easy: you simply identify the customer when they first sign up or login and we will store a cookie in order to track their actions from that point onward. For the sake of this help article we’ll assume you’re using our Javascript library. If you’d like more details on our API and more complex setup, refer to our full API reference.When to identify customers
You should identify a customer when they first subscribe to a newsletter or register for your service. To track a customer using the javascript library, you do the following:Capturing an email address
We find that, generally, our customers are already handling their own newsletter subscription forms and logins. At this time the best way to technically capture the email address is to call the javascript code in the section above on a thank you page after a customer submits a newsletter subscription form or on a welcome page after a customer signs up. Note : It’s best practice to re-identify a customer whenever they login. This ensures their cookie is up to date and that events are recorded against the correct customer, particularly if they share their computer with others.Platform-specific examples
Magento
When using Magento there are three places we’d recommend you identify a customer in order to maximise your ability to track their lifecycle events: After a customer submits your newsletter form, add the following javascript alongside the thank you notice on the homepage:Facebook Connect
If you use Facebook Connect to allow customers to sign up, you can easily identify the customer when the Facebook OAuth returns them to your site. Depending on your implementation, Facebook will generally redirect the customer back to your website in the following format:YOUR_REDIRECT_URI#
In this instance you can use the Facebook USER_ACCESS_TOKEN to get more information about the customer. In order to get their email (which you need for email marketing!) you must request access to the ‘email’ scope. See the Facebook Documentation for further information. Once you have the customer’s email, simply call the following code to identify them:

