Automatically append end of URL with CJ ID?

Discussion in 'Commission Junction' started by kelp, May 23, 2009.

  1. #1
    Hey,
    I will constantly link to different CJ merchants, but it takes a lot of time to add the affiliate tag at the end of each URL. Is there a way to automatically add my affiliate ID to the end of an url if it leads to a CJ affiliate?
     
    kelp, May 23, 2009 IP
  2. jmhyer123

    jmhyer123 Peon

    Messages:
    542
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The best way would probably be to use javascript. something like this will append your aff id to the end of every url but you would have to modify it to make it work on only CJ links:

    
    var links = document.getElementsByTagName('a');
    
    for (var i = 0; i < links.length(); i++) {
         links[i].href = links[i].href + "&aid=9999999999";
    }
    
    Code (markup):
    Like I said that is a very basic script that would get the job done but definitely needs to be fine tuned in order to provide the correct results you're looking for.


    Hope this helps!
     
    jmhyer123, May 23, 2009 IP
  3. longblog

    longblog Active Member

    Messages:
    417
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    50
    #3
    If you're using WP then you can install the cross-linker plugin to turn specific words or phrases anywhere within your articles into links
     
    longblog, May 23, 2009 IP