[SOLVED] Need to add a affiliate conversion pixel to a specific page
For a site I have built, I need to add an affiliate program conversion pixel to a 'thank you' page, which is actually a normal page, added through the dashboard.
Since all pages use the index.php of Atahualpa as a template, I would need to add code in there that calls the thank you page by id and then echoes the conversion pixel in that page The one thing I am not sure of is what code to use to make that pixel echo only on that thank you page. The pixel code is: HTML Code:
< ? php |
Why not use one of the options in the 'Add HTML/CSS Inserts' option? Just stick it on all pages
Or you could accept a new widget area and a php aware plugin to only show it on that page. That way you won't have to update it after a theme upgrade. |
Don't I feel stupid... :)
I stripped the: <?php echo ' from the pixel, and just added it in a plain text widget to the sidebar. I am using the "Display Widgets" plugin, so only showing it on the specific page is a breeze. Many thanks for your lighting fast advice!! |
I was too eager I'm afraid, the pixel wont display correctly.
It seems there is no other way than to edit index.php and modify it each time after an update. Since I prefer to be safe over being sorry, could you advise if this will work when entered in the index.php of atahualpa: <?php if (is_page('bedankt-voor-uw-aanvraag') ): ?> <?php echo '<img src="https://urlhere.com/?cid=', ($cid = 'IDhere'), '&pid=otheridhere&tid=' . urlencode($order->id) . '&tam=', urlencode(!empty($order->order_total) && !empty($order->order_tax) ? $order->order_total - $order->order_tax : $order->get_formatted_order_total()) ,'&data=', urlencode(!empty($_COOKIE['TT2_' . $cid]) ? $_COOKIE['TT2_' . $cid] : null), '" width="1" height="1" border="0" alt="" />'; ?> <?php endif; ?> |
Why not use a plugin like exec-php and put that code in a text widget?
|
All times are GMT -6. The time now is 08:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.