dxszzcylm 发表于 2012-5-24 00:31:51

mmm cookies

I am currently dropping cookies using this method:<img src="http://www.xxx.com/go/xxx" alt="" width="1" height="1" />where /go/xxx is my gocodes wordpress plugin redirection. I only have a few affiliate accounts and so far I have not been pulled up on it. They're probably glad of the sales!

Do you think I'm OK continuing this way or could I work smarter?

dxszzcylm 发表于 2012-5-24 00:32:58

I seriously recommend something else. The page where you want to drop the cookies on - add a .htaccess file in your domain-root that says:RewriteEngine ON
RewriteRule ^footer-bottom.png$ http://www.your-affiliate-link.com/ Head over to your stylesheet, add:.footer_bottom {
background-image:url(http://www.your-url.com/footer_bottom.png)
}Now edit your Template, and add following code to your footer-code:

PHP Code:<div class="footer_bottom"></div> Weee! No red "X" saying that this image doesn't exist, since it's loaded via the stylesheet, people will just not see it. :p

Best Regards

dxszzcylm 发表于 2012-5-24 00:33:32

OK, thanks Nuls, I'll test it later and let you know if I have any problems.:thumb:

dxszzcylm 发表于 2012-5-24 00:33:43

nice, i used to only do the mod_rewrite stuff without css..

dxszzcylm 发表于 2012-5-24 00:34:08

Here's my modified .htaccess file where xxx is the uncloaked affiliate link:# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
RewriteRule ^footer-bottom.png$ http://www.xxx.com/xxxx/
</IfModule>

# END WordPressI have edited the stylesheet and footer as shown.

1 - how do I verify it works? I assume I should still get clicks on my aff stats?
2 - how do I add extra lines to the .htaccess file for all my other affiliate links?

dxszzcylm 发表于 2012-5-24 00:34:26

You could d/l fire cookie for firebug, and monitor the cookies dropped.

dxszzcylm 发表于 2012-5-24 00:34:55

Thanks, I think one way or another I can verify the cookies loading. I just need to know how to handle multiple cookies?

cheers

Here is my code again;# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
RewriteRule ^footer-bottom.png$ http://www.xxx.com/xxxx/
</IfModule># END WordPress

dxszzcylm 发表于 2012-5-24 00:35:15

You'd need to set up different RewriteRules for any cookie, this was exactly the reason why I've made TCL, it pretty much sucks doing that manually on different domains.

i.e.RewriteRule ^footer-bottom.png$ http://www.xxx.com/xxx/
RewriteRule ^another-footer.png$ http://www.xxx2.com/xxx/ Now you'd need to create another div-class in your stylesheet and then randomly pick one of each in your template.

dxszzcylm 发表于 2012-5-24 00:35:37

oh, man! now I need to save up for TCL :mad: Was there a discount offer?

Tell you what though... I noticed that using the<img src="http://www.xxx.com/go/xxx" alt="" width="1" height="1" />actually loads a lot of the merchant site files, not just the aff cookie! Removing it has halved my page load time! Also I am now using Hyper Cache which has helped a lot too. Perhaps I'll make some more sales from the more impatient visitors now!

dxszzcylm 发表于 2012-5-24 00:35:53

Never ever use <img src>, AM will notice that, because, as you have already seen yourself, much stuff is being loaded. Doing it the "CSS Way" will not trigger these issues.

Coupon -> http://www.thecookielabs.info/?r=Larceny

Best Regards

dxszzcylm 发表于 2012-5-24 00:36:14

Thanks Nuls - it'll be an early birthday present!

dxszzcylm 发表于 2012-5-24 00:36:25

Hi Larceny and Nuls! TCL purchased - awaiting download details, cheers!

dxszzcylm 发表于 2012-5-24 00:36:35

.footer_bottom {
background-image:url(http://www.your-url.com/footer_bottom.png) is the your-url.com my domain url or the affiliate offer url

dxszzcylm 发表于 2012-5-24 00:36:45

hat is YOUR domain/footer-bottom.png which doesn't really exist.. but yeah, add your domain there...
页: [1]
查看完整版本: mmm cookies