Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: jacosky on April 09, 2018, 10:34:46 pm

Title: CPA Tracking Code
Post by: jacosky on April 09, 2018, 10:34:46 pm
I want to run a CPA campaign to my site where I get to only pay for successful registrations. Please where can I locate the registration success page so that I can integrate the CPA tracking code?

Any help will be appreciated.
Title: Re: CPA Tracking Code
Post by: WEBmods on April 09, 2018, 11:37:26 pm
Hello,

You could use something like this:

Code: [Select]
<?php

function trackingCode($userId) {
    
// do something...
}
osc_add_hook('user_register_completed''trackingCode');

?>


Hook explanation (from https://doc.osclass.org/Hooks):


Regards.
Title: Re: CPA Tracking Code
Post by: jacosky on April 10, 2018, 06:38:10 pm
Thanks a lot Patrick but I'm not a techie, so please be patient with me.

In which file will I paste this code above?

Secondly, where will I paste my CPA tracking code generated from my ad network?
Title: Re: CPA Tracking Code
Post by: WEBmods on April 10, 2018, 09:57:03 pm
That code should be placed in functions.php of your theme (oc_content/themes/theme_name/functions.php), but it still does nothing. Could you provide your tracking code? Without it I don't know how you should implement it. If it's Javascript you can just do this:

Code: [Select]
<?php

function trackingCode($userId) {
    echo 
"my tracking JS";
}
osc_add_hook('user_register_completed''trackingCode');

?>


Regards.
Title: Re: CPA Tracking Code
Post by: jacosky on April 10, 2018, 10:15:38 pm
Thank you Patrick. This is my tracking code:
Code: [Select]
<!-- NG Adverts - Tracking Code -->
<script data-cfasync="false" type="text/javascript" src="//www.ngadverts.com/ng/display/index.php?page=click/conversion/1011"></script>
<!-- NG Adverts - Tracking Code  -->

Title: Re: CPA Tracking Code
Post by: WEBmods on April 11, 2018, 01:12:33 pm
Just paste this into functions.php:

Code: [Select]
<?php

function trackingCode($userId) {
    echo 
'<!-- NG Adverts - Tracking Code --><script data-cfasync="false" type="text/javascript" src="//www.ngadverts.com/ng/display/index.php?page=click/conversion/1011"></script><!-- NG Adverts - Tracking Code  -->';
}
osc_add_hook('user_register_completed''trackingCode');

?>


Regards.