I have been asked to add some javascript twitter tracking code on my site which should track when a new customer registers.
In my store there is no dedicated page for a successful signup for me to place this code, it just directs the customer to their acccount dashboard.
I have had a look at the event when a customer registers and it seems that it is called in:
Mage > Customer > controllers > AccountController.php
In line 526:
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
$this->_getSession()->addSuccess(
$this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName())
);
I thought by adding my javascript code onto the register success message like so it would add the tracking code onto the page:
protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
{
$tracking = '<div id="track"><script ....</script></div>';
$this->_getSession()->addSuccess(
$this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName() . $tracking)
);
But it doesn't seem to be tracking with this. Is this correct or is there another way of doing so?