Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25182

    Hi,

    I would like to use the cross-domain tracking code from Google Analytics (https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite)

    I was wondering how I can insert the code for the external link in the following 2 situations:

    1) Using a button

    Current code:

    [av_button label='Test' link='manually,http://www.test12345.nl/' link_target='' color='custom' custom_bg='#FAAB45' custom_font='#ffffff' size='medium' position='under' icon_select='no' icon='25']

    2) In the main navigation / menu for one of the items/link. This link should also open in a new window

    So following the instructions of Google, I need to add somehow the following code:

    <a href=”http://www.test12345.nl&#8221;

    onclick=”_gaq.push(); return false;”>

    Test

    Many thanks in advance!

    #126056

    1) You can modify the button shortcode – open up wp-contentthemesenfoldconfig-templatebuilderavia-shortcodesbuttons.php and replace:

    $output .= "<a href='{$link}' class='avia-button ".$this->class_by_arguments('icon_select, color, size, position' , $atts, true)."' {$blank} {$style} >";

    with

    if($link == 'http://www.test12345.nl') {
    $output .= "<a href='{$link}' onclick="_gaq.push(['_link', 'http://www.test12345.nl']); return false;" class='avia-button ".$this->class_by_arguments('icon_select, color, size, position' , $atts, true)."' {$blank} {$style} >";
    }else{
    $output .= "<a href='{$link}' class='avia-button ".$this->class_by_arguments('icon_select, color, size, position' , $atts, true)."' {$blank} {$style} >";
    }

    2) This is imo not easily possible. You can try a plugin like http://wordpress.org/plugins/jin-menu/ but I’m not sure if it works.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘add cross-domain tracking code’ is closed to new replies.