Support » Plugin: URL Params » Great Plugin! Quick question…

  • Hi, first of all, thanks for this great plugin. It’s super useful for my PPC campaigns.

    My quick question:

    In Adwords I like to use broad match modified, which gives me the a query string format like this:

    ?utm_term=%2Bword1%2Bword2

    (the %2B is the html encoded + character. The + character in front of a keyword indicates it’s a “broad match modified” keyword in Adowrds)

    The problem is: the 2 word query string phrase includes the + signs when I output it on my landing page.

    Any chance you could point me to how I could filter out the + signs when outputting the contents of the query string on my page?

    Would really help me greatly, thanks.

    P.S. I’m comfortable with php so feel free to point me to where and how to change/modify it myself.

    Cheers, Paul

Viewing 5 replies - 1 through 5 (of 5 total)
  • Figured something out.

    I added this line:

    
    //Filters out special characters passed along with Adwords keywords
    $return = ucwords(trim(preg_replace('/[^A-Za-z0-9\-]/', ' ', $return)));
    

    I placed it just before this line:

    
    return $return;
    

    It works.

    • This reply was modified 2 years, 7 months ago by  JanPaul999.

    Or this code works also:

    
    $return = str_replace('+', ' ', $return);
    $return = str_replace('[', ' ', $return);
    $return = str_replace(']', ' ', $return);
    $return = ucwords(trim($return));
    

    Actually, the + sign is the only sign that needs to be filtered from what Adwords passes in the URL. Other match types don’t pass special characters.

    Here is the final code I ended up with after some testing:

    
    //Filters out the + characters passed along with Adwords keywords set to "broad match modified".
    $return = ucwords(str_replace('+', ' ', $return));
    
    • This reply was modified 2 years, 7 months ago by  JanPaul999.

    Thanks Paul,

    Do you worry about the code being overwritten when the plugin is updated?

    Marc

    Yes that’s an area of concern. I might accidentally do this at some point.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Great Plugin! Quick question…’ is closed to new replies.