Results 1 to 11 of 11
  1. #1
    Newbie
    Join Date
    May 20th, 2007
    Posts
    4
    Help With A Script - Alternative To Google Conv. Tracking
    Hi there!

    We're running a review site with lots of pages, and our Adwords campaign exists of dozens of groups (in order to accurately target each keyword).

    We have asked our affiliate manager to insert our Adwords conversion tracking code into the "Thank you" page but he refused. This affiliate is very profitably so we don't want to quit the program.

    Unfortunately they are not in the clickbank directory so that's not an option. I was thinking of using the same principle used to cover affiliate links. Instead of:

    www.hop.clickbank.com it would display: www.mysite.com/product/.

    In the /product/ folder there is an index.php file with the following code:

    Code:
    <?PHP
    
    Header("Location: http://www.productsite.com/affiliate-id");
    Exit;
    
    ?>
    That works perfectly. However, what if this script can also be used to open another url first? In this case the url of a page located on my own site, that contains the Adwords code in the .html coding. For instance;

    Code:
    <?PHP
    
    Header("Location: http://www.mysite.com/tracking.html");
    Header("Location: http://www.productsite.com/affiliate-id");
    Exit;
    
    ?>
    Would this work? Or does anyone know how to do this, or have a suggestion using a similar way?

    I would really appreciate any help here. Currently we're still shooting in the dark and we're stuck with having to test each group seperately which is highly timeconsuming.

    Thanks in advance for your time.

    Regards, Maarten & Rudolf

  2. #2
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    you're not going to be able to send them to two places like you've suggested, but firing off the conversion tracking code on your site, to act as a proxy action replacing sales (triggered from the merchant's thank you page) is a good idea - one i've done many times.

    so google conversion snippet is placed on a page like go1.php. that page has the conversion snippet to trigger a g tracked event (not a sale, but a signup or whatever event you'd like to choose) -and- the page receives the destination url (or looks it up in your database via php/mysql) and passes the target destination to a page like go2.php (which is like your suggested page where you do a header redirect to the target location (which you may pass from go1 to go2.

    so in this way, an intermediate page is momentarily created that tracks the hand off event, and then sends the person on to go2 which redirects them to the merchant.

    it's not as good as having a cooperative merchant who lets you complete the sales loop, but it's a good proxy for it.

  3. #3
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    and hey, remember, once you pass the header command, nothing else happens on that page of yours - cuz the visitor gets redirected away right then...

    and you can't pass more than one header because the php function is designed to prevent more than one header to be sent at once as a protection against header injection attacks.

    also, the rendering / activating of the header redirect won't work properly if you send something to the page that displays in html first... see the section starting here:
    http://us2.php.net/header
    that begins with:
    "Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file."

  4. #4
    Newbie
    Join Date
    May 20th, 2007
    Posts
    4
    Hi Donuts,

    Thanks for your reply. It seems like a great idea, and all figured out. However, my coding skills are very poor. The code I posted above is one suggested by another person. I found it to be extremely easy and obvious so that's why I used it.

    Do you know where I can copy and past such a code, with only having to replace the urls, etc.? That way I can just paste the code into the page, and create pages accordingly.

    Your help is very much appreciated. Thanks again for your time.

    Regards, Rudolf

  5. #5
    Believe knight01's Avatar
    Join Date
    August 14th, 2006
    Location
    Dayton, Ohio
    Posts
    1,815
    If I understand what you want to do, and maybe I don't. you'd setup a click-through link on the page with the keywords/products. The link will go to a tracking page.

    a href="http://www.productsite.com/track.php">click here</a>

    Then on the track.php you'd want it to look like this:

    google conversation javascript
    <?
    //(important not to put anything that will print to screen!)
    Header("Location: http://www.productsite.com/affiliate-id");
    ?>

    This should invoke the conversion with google, then go to the affiliate site.

    You could switch the affiliate id / landing page with a variable and pass that along in a post or get statement that way if you're sending them to different places you only need one tracking page. The google tracking would have to be modified to track the different events, I've not look at it so not sure how hard it would be to do it.

    Hope that is clear as mud.

  6. #6
    Newbie
    Join Date
    May 20th, 2007
    Posts
    4
    Hi Knight01,

    Yes, that's exactly how I want it.

    When the visitor wants to go to the merchants website, he can click a link that says "Visit Website", which has the url "http://www.mywebsite.com/productname/". I'm using this folder link to cloak the real link. Otherwise it would display "http://www.merchantwebsite.com/myaffiliateid" which reduces credibility to the visitor.

    Now in the /productname/ folder there's the index.php file. When linked to the folder it'll automatically search for an index file, so that's easy. In that index.php file there's a code that redirects the browser to the merchants website. At this stage the visitor won't see my affiliate url displayed anymore in the address bar.

    I've tried doing as you said, but if I put the Google conversion tracking code on top of the piece of coding I already had its giving me en error. I tried this piece of coding:

    Code:
    <!-- Google Code for pageview Conversion Page -->
    <script language="JavaScript" type="text/javascript">
    <!--
    var google_conversion_id = 1060033085;
    var google_conversion_language = "en_US";
    var google_conversion_format = "1";
    var google_conversion_color = "FFFFFF";
    if (1) {
      var google_conversion_value = 1;
    }
    var google_conversion_label = "pageview";
    //-->
    </script>
    <script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/1060033085/imp.gif?value=1&label=pageview&script=0">
    </noscript>
    
                                        
    <?PHP
    
    header("Location: http://www.pherlure.com/i/i.php?id=2212");
    exit;
    
    ?>
    An error will come up saying it cannot redirect again, or something similar along that way. Did I do something wrong?

    I hope you can help me out. You've been of great help so far.

    Thanks, regards, Rudolf

  7. #7
    Member
    Join Date
    December 6th, 2006
    Location
    na
    Posts
    173
    You might try something like this. Place the conversion code in a file, which we'll call conversion.html..

    then the index.php code should look like this:
    PHP Code:
    <?PHP
    $fp 
    'conversion.html';
    fopen($fp'r');
    fclose($fp);
    header("Location: http://www.pherlure.com/i/i.php?id=2212");
    exit;

    ?>
    Hopefully this should work - what we're doing is opening the page with the conversion code so google can register the conversion, then we're sending the user on to the affiliate link. Since no data has been sent yet, it should be ok if the header command is underneath the file processing.

    If this doesn't work let me know, I'll find another solution.

  8. #8
    Believe knight01's Avatar
    Join Date
    August 14th, 2006
    Location
    Dayton, Ohio
    Posts
    1,815
    Yep, it's because it looks like google is printing a pixel for tracking

    See here:
    <noscript>
    <img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/1060033085/imp.gif?value=1&label=pageview&script=0">
    </noscript>

    If the solution posted by oziman doesn't work, you can try the one below. I tested it on my server and it works. It is NOT the ideal solution, as it is all javascript... and of course there are people with javascript turned off. But it will at least get you going.




    Code:
    <!-- Google Code for pageview Conversion Page -->
    <script language="JavaScript" type="text/javascript">
    <!--
    var google_conversion_id = 1060033085;
    var google_conversion_language = "en_US";
    var google_conversion_format = "1";
    var google_conversion_color = "FFFFFF";
    if (1) {
      var google_conversion_value = 1;
    }
    var google_conversion_label = "pageview";
    //-->
    </script>
    <script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>
                                        
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    window.location="http://www.pherlure.com/i/i.php?id=2212";
    // End -->
    </script>
    
    <noscript>
    click <a href="http://www.pherlure.com/i/i.php?id=2212">here</a>.
    </noscript>

  9. #9
    Lite On The Do, Heavy On The Nuts Donuts's Avatar
    Join Date
    January 18th, 2005
    Location
    Winter Park, FL
    Posts
    6,930
    or you could try the 2 page idea (go1, go2) i suggested earlier (having dealt with these problems before).

    :-)

  10. #10
    Newbie
    Join Date
    May 20th, 2007
    Posts
    4
    Thanks all for your help, thanks so much!

    I also tried the code Oziman suggested, but it displayed en error, something about "fopen". However, the other code Knight01 suggested fortunately works. Now I just have to check if Adwords will registrate the conversions, but at least the affiliate link remained intact so that keeps my hopes up!

    I didn't want to force the visitor to go through another page first, because internet users are lazy, and want things to go easy, and fast. I can tell this from my own experience.

    I'll let you guys know if the conversion tracking works with this code.

    Thanks again for all your support!

    Regards, Rudolf

  11. #11
    Member
    Join Date
    December 6th, 2006
    Location
    na
    Posts
    173
    Just going through my posts - can you post the error fopen gave so I can know what went wrong if someone else needs this advice in the future?

    thanks!
    oziman

  12. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Google Adwords Alternative
    By wackintosh in forum Building Traffic, Newsletters & Advertising
    Replies: 6
    Last Post: December 4th, 2014, 01:09 PM
  2. 10 Alternative Search Engines To Google
    By Chuck Hamrick in forum Search Engine Optimization
    Replies: 19
    Last Post: April 8th, 2014, 10:59 AM
  3. Alternative for Matt's search script
    By Affiliate Ian in forum Programming / Datafeeds / Tools
    Replies: 23
    Last Post: October 1st, 2005, 05:04 PM
  4. Google AdSense Alternative Banner URL
    By Radegast in forum Search Engine Optimization
    Replies: 4
    Last Post: November 12th, 2003, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •