Conversions tracking

Is it possible to track conversions after the process of registration? (Google Ads)

Now we are tracking conversions (Google Ads) just after opening the page with a registration form (/apps/customer/views/guest), but we would like to track it after the process of successful registration. Where should we put the code?
 
Since there is no intermediary page, it will be difficult to do so.
People will get redirected to the dashboard after registration, so you could potentially check the http referrer and see if them come from the registration and if they do, trigger the tracking code.
Here's a possible way to do it:
PHP:
<?php
// this code goes into /apps/init-custom.php

Yii::app()->hooks->addAction('after_opening_body_tag', function($controller) {
    if ( !Yii::app()->apps->isAppName('customer') || $controller->id != 'dashboard' ) {
        return;
    }
    if (stripos(Yii::app()->request->getUrlReferrer(), '/register/') === false) {
        return;
    }
    ?>
    <script>
    // add here your tracking logic
    </script>
    <?php
});
It's not tested, you should get the idea though.
 
Last edited:
Back
Top