Google conversion code placement

emailpapa

New Member
Hello,

Some one please help me with this

i need to place google conversion tracking code after payment process. in which file i need to place the code ? if i receive after payment.
 
@emailpapa - you could create a file called init-custom.php in the /apps/ folder with this content:
PHP:
<?php

Yii::app()->hooks->addAction('before_view_file_content', function($collection){
    if ($collection->controller->id != 'price_plans' || $collection->controller->action->id != 'index') {
        return;
    }
    if (!Yii::app()->notify->hasSuccess) {
        return;
    }

    // customer just bought a plan
    ?>
    <script>...</script>
    <?php
});
BUT you won't have access to the order data, you would just know that an order has been created. You could query the database and get latest order for this customer... but again, this is very limited...
 
Back
Top