Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   eCommerce & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=31)
-   -   [SOLVED] Need to add a affiliate conversion pixel to a specific page (http://forum.bytesforall.com/showthread.php?t=22476)

Erwin May 6, 2014 05:23 AM

[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
echo <img src= [i]wont bore you with the actual pixel details[/i] alt="" />

Your help is greatly appreciated!

juggledad May 6, 2014 05:39 AM

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.

Erwin May 6, 2014 05:59 AM

Don't I feel stupid... :)

I stripped the:

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!!

Erwin May 8, 2014 05:14 AM

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') ): ?>


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; ?>

juggledad May 10, 2014 06:38 AM

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:38 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.