Wordpress Thank You Page / Pixel Tracking

bobbylove321

BANNED
Joined
Nov 8, 2008
Messages
1,986
Reaction score
2,129
Hi,

Does anyone know how I can place the conversion tracking pixel from a cpa / cpv network on a wordpress thank you page?

I have looked many places for some sort of a plugin but I cannot find any.

I just want to place the tracking code that the network provided me and put it on the thank you page. (The thank you page is simply a wordpress post)

Thanks
 
If you can't find a plugin to do that, I have a solution but it may not be easy if your not a bit code-savvy.

Basically duplicate the "single.php" file of your WP theme and make it a custom post template that you will use with your thank you page; and add your tracking code in this template.
 
If you can't find a plugin to do that, I have a solution but it may not be easy if your not a bit code-savvy.

Basically duplicate the "single.php" file of your WP theme and make it a custom post template that you will use with your thank you page; and add your tracking code in this template.

That's a bit complicated.

I would think that it would be easy to place a tracking pixel on a specific wordpress page.
 
I have no idea what your code looks like, but just paste this in single.php

if(is_single('post-slug')){
// your tracking code here....
};

That's it, then code will execute only on the post with that slug.
 
I have no idea what your code looks like, but just paste this in single.php

if(is_single('post-slug')){
// your tracking code here....
};

That's it, then code will execute only on the post with that slug.

That's a better solution, I should have thought about it too ;)
However the tracking code is probably not php so it should be either echoed or php tags must be open/closed properly such as:

Code:
if(is_single('post-slug')){ ?>

[tracking code goes here ]

<?php };
 
That's a better solution, I should have thought about it too ;)
However the tracking code is probably not php so it should be either echoed or php tags must be open/closed properly such as:

Code:
if(is_single('post-slug')){ ?>

[tracking code goes here ]

<?php };
True :)
 
That's a better solution, I should have thought about it too ;)
However the tracking code is probably not php so it should be either echoed or php tags must be open/closed properly such as:

Code:
if(is_single('post-slug')){ ?>

[tracking code goes here ]

<?php };

How would wordpress know which specific post is the thank you page if I put that code in the single.php?

Wouldn't that make all the single posts have the code?
 
How would wordpress know which specific post is the thank you page if I put that code in the single.php?

Wouldn't that make all the single posts have the code?
Where it says post-slug in the code, replace that with an actual post-slug of thank you page.
 
Where it says post-slug in the code, replace that with an actual post-slug of thank you page.

Thanks for your help.

But I found an easier way to do it.

It was the theme I was using, so I had to go the html of the specific post, and paste the code, and not change it back to plain text.

This worked.
 
Yeah, glad you fixed it. Kepp the code in mind when you will need php code inserting on single post ;)
 
Back
Top