Application note Advertisers: Recommendations regarding how to integrate Reactivpub tags in Joomla Version 1.0.1
Introduction Objective Reactivpub, an affiliation platform based on the R-ADServer technology developed by the R corporation, allows affiliates (or broadcasters: internet sites that want to profit from their available advertising space) to be connected to advertising sites that want to promote or sell their products. Different technical and financial models exist to allow broadcasting ads. They differ most distinctly in how they are implemented. This document presents the technical recommendations provided by R in order to integrate tags from the Reactivpub broadcasting platform within the framework of sales advertising campaigns, for sites based on CMS Joomla 1.0.13 and Virtuemart 1.0.14 (Virtuemart is an add-in to Joomla that lets integrate an online shop to a Joomla-based site.) Who is this document for? This document will be useful to webmasters, administrators or developers who want to use Reactivpub technology on their Joomla-based internet site. Warnings As Joomla is a product that you might have modified for your own purpose, we strongly advise that you: - Back up all the files that will be modified when you follow the procedures described in this document. - Implement those changes first on your development platform in order to check that it works correctly with your configuration, before implementing them on your production platform. Despite all the care we took in developing this document, it might still contain errors. Kindly send all comments or questions to production@r-advertising.com. The information in this document is subject to change without notice. Advertisers : recommendations regarding how to integrate Reactivpub tags in Joomla 2
Principle Overview Reactivpub tracking system is compatible with the main payment solutions available. Two tags must be inserted on the advertiser s Joomla-based website: A transaction marking tag (lead or sale), and a transaction validation tag. Transaction marking tag: tracking.php The call to this first tag must appear before the call to the payment request, in the last page viewed by the user (for instance, in the order confirmation page.) The model for the tag is: <iframe src="http://nodes.reactivpub.fr/scripts/tracking.php? params=p1 P2&id_transaction=P3&track=P4&prix=P5 width="1" height="1" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe> In this tag: - P1 and P2: values provided by Reactivpub, unique to your campaign. You can find those values in the advertiser s tag topic for your campaign in the Reactivpub administrative interface, or they can be provided by your account manager. - P3: a unique identifier for the transaction that s starting. In general, it can be an order number, or several pieces of data bundled together (order number + amount of the order + date of the order ) as long as its value is unique. - P4: represents the email address of the client doing the transaction (the purchase.) - P5: the total price for the transaction. Important: All parameters (P1 to P5) must have a value when calling tracking.php Example: <iframe src="http://nodes.reactivpub.fr/scripts/tracking.php?params= 123 4567&id_transaction=ABCDE12345&track=test@test.fr &prix=9876.43 width="1" height="1" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe> Advertisers : recommendations regarding how to integrate Reactivpub tags in Joomla 3
Transaction validation tag: tracking_transaction.php This second tag must be called in a PHP script on the site, once the payment has been made. The call can be made for instance in the order validation script invoked by the payment scheme, or in a script that sends an order confirmation email. Unlike the first tag, this tag can be called outside any browser. The model for the tag is: http://nodes.reactivpub.fr/scripts/tracking_transaction.php? params=p1 P2&id_transaction=P3 All parameters (P1, P2, and P3) must have the same values as when calling tracking.php Important: All parameters (P1 to P3) must have a value when calling tracking_transaction.php Example: http://nodes.reactivpub.fr/scripts/tracking_transaction.php? params=123 4567&id_transaction=ABCDE12345Z Comments: - Calling the tracking_transaction.php tag records the transaction in the pending state in the Reactivpub administrative interface. You can then definitely accept or reject it. - The tracking_transaction.php must only be called if the payment was accepted. If not accepted, then the tag should not be called. Advertisers : recommendations regarding how to integrate Reactivpub tags in Joomla 4
Integrating tags Step 1: placement of the tracking.php tag Edit the checkout.index.php file located in the Joomla folder named administrator\components\com_virtuemart\html and insert the Reactivpub code liste below, after line 207, below the following source code: elseif ($checkout_this_step == CHECK_OUT_GET_FINAL_CONFIRMATION) { // -CHECK_OUT_GET_FINAL_CONFIRMATION // shows a total summary including all payments // Now llet the user confirm Line 207?> Insert the Reactivpub code starting here Reactivepub code to insert line 208. Make sure that you replace the values for the P1 and P2 parameters with those that correspond to your campaign: <?php // // Reactivpub : call tracking tag // // Get session ID and date $reac_date = date("dmyhis"); $_SESSION["date"] = $reac_date; $reac_session_id = session_id(). "-". $reac_date; // Cleaning $reac_session_id = str_replace(" ", "", $reac_session_id = str_replace("/", "", $reac_session_id = str_replace(";", "", // Get customer s email $reac_dbbt = new ps_db; $reac_qt = " SELECT * FROM # {vm}_user_info WHERE "; $reac_qt.= " user_id='".$auth['user_id']."' AND "; $reac_qt.= " address_type='bt' "; $reac_dbbt->query($reac_qt); $reac_dbbt->next_record(); $reac_track = $reac_dbbt->f("user_email"); // Get total price $reac_prix = $order_total + $tax_total; $reac_prix = round($reac_prix, 2); Advertisers : recommendations regarding how to integrate Reactivpub tags in Joomla 5
// Build first tag (client tag) // (Warning : replace P1 P2 with campaign specific IDs // given by Reactivpub) $reac_iframe = '<iframe '; $reac_iframe.= 'src="http://nodes.reactivpub.fr/'; $reac_iframe.= 'scripts/tracking.php?params=p1 P2'; $reac_iframe.= '&id_transaction='.$reac_session_id; $reac_iframe.= '&track='.$reac_track; $reac_iframe.= '&prix='.$reac_prix.'" '; $reac_iframe.= ' width="1" height="1" marginwidth="0" '; $reac_iframe.= ' marginheight="0" frameborder="0" '; $reac_iframe.= ' scrolling="no">'; $reac_iframe.= '</iframe>'; // Call Reactivpub tag echo $reac_iframe;?> Comments: This code sets the value for the P3 parameter (id_transaction) as the concatenation of the PHP session ID for the visitor and the current date. Step 2: placement of the tracking_transaction tag Edit the ps_checkout.php file located in the Joomla folder named administrator\components\com_virtuemart\classes\ and insert the Reactivpub code listed below, at the start of the email_receipt() function (after line 1451, right after the definition of the global variables): Line 1447 function email_receipt($order_id) { global $sess, $ps_product, $VM_LANG, Line 1451 $mosconfig_smtpuser, $mosconfig_smtppass, ; Insert the Reactivpub code starting here Reactivepub code to insert line 1452. Make sure that you replace the values for the P1 and P2 parameters with those that correspond to your campaign: // Get session ID and date $reac_date = $_SESSION["date"]; $reac_session_id = session_id(). "-". $reac_date; // Cleaning $reac_session_id = str_replace(" ", "", $reac_session_id = str_replace("/", "", $reac_session_id = str_replace(";", "", Advertisers : recommendations regarding how to integrate Reactivpub tags in Joomla 6
// Build second tag (server to server tag) // (Warning : replace P1 P2 with campaign specific IDs // given by Reactivpub) $reac_url = "http://nodes.reactivpub.fr/scripts/"; $reac_url.= "tracking_transaction.php?"; $reac_url.= "params=p1 P2"; $reac_url.= "&id_transaction=". $reac_session_id; file($reac_url); Comments: The file(..) instruction will only work with an URL if the PHP option fopen wrappers has been set (php.ini: allow_url_fopen = On). For more information, please check http://fr.php.net/manual/en/function.fopen.php. Finalizing the setup Tests and validation Once you re done with the edits, you must run some test transactions, for instance: - Add some products to the shopping basket, confirm the order then send a payment that will be accepted - Add some products to the shopping basket, confirm the order then send a payment that will be rejected Be sure to write down, for each transaction, the amount for the order and the email address that you use. During these tests, no PHP or Javascript errors or alerts must be returned. Then, connect to the Reactivpub administrative interface and check that the test transactions for which payment was accepted are indeed listed as pending validation. You can then reject them in order to delete them from the list. Please note that you might have to wait a little while before the test transactions appear in the list of transactions that need to be validated. If you wish, you can contact your account manager for him or her to check for you that the transactions were recorded correctly. Advertisers : recommendations regarding how to integrate Reactivpub tags in Joomla 7