Help: Wordpress Plugin

Discussion in 'PHP' started by NYSkyline, Oct 27, 2011.

  1. #1
    I'm trying to setup outbound link tracking in Google Analytics, I want to track to see if my social media icons are driving traffic to my social media accounts. In order to do this I need to add the following code to my <a href=""> link <a href="http://www.example.com" onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">


    Here is the code from the plugin I'm using

    // Facebook
    if ( $facebook != '' && $facebook != ' ' && file_exists($smw_dir.'/facebook.png')) {
    ?><a href="<?php echo $facebook; ?>" <?php echo $nofollow; ?> <?php echo $newtab; ?>><img src="<?php echo $smw_path; ?>/facebook.png" alt="<?php echo $imgcaption; ?> Facebook" title="<?php echo $imgcaption ?> Facebook" <?php if($animation == 'fade' || $animation == 'combo') { ?> style="opacity: <?php echo $icon_opacity; ?>; -moz-opacity: <?php echo $icon_opacity;?>;" <?php } ?>class="<?php echo $animation; ?>" /></a><?php
    } else {
    echo ''; //If no URL inputed
    }

    So my question is how do I get the above html attributes to be served from the above php code.

    Thanks in advanced
     
    NYSkyline, Oct 27, 2011 IP
  2. amgadhs

    amgadhs Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Did you try plugins that track outbound links in Analytics, like Yoast Google Analytics?
     
    amgadhs, Oct 29, 2011 IP