• In my Google Analytics I am seeing a mix of “outbound-article” and “outbound-article-” events. I’m using version 5.0.5.

    On inspection most of the “outbound-article-” events are internal links incorrectly being flagged as outbound events, e.g.,

    https://www.unitedworldschools.org/#section-about
    “Watch the rest of the series on our YouTube channel.” is correctly being tracked as an “outbound-article”

    <a href="https://www.youtube.com/watch?v=FC48PkW4NkA&list=PL3rae0govpkj1z9WtL9MnEn0rsvp7C9PP" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'https://www.youtube.com/watch?v=FC48PkW4NkA&list=PL3rae0govpkj1z9WtL9MnEn0rsvp7C9PP', 'Watch the rest of the series on our YouTube channel.']);" title="Watch the rest of the series on our YouTube channel" target="_blank">Watch the rest of the series on our YouTube channel.</a>

    on the other hand, “transforming the lives” is an internal link as is incorrectly being flagged as “outbound-article-“

    <a href="https://www.unitedworldschools.org/transforming-lives-uws-ka-narng-ket-school/" onclick="_gaq.push(['_trackEvent', 'outbound-article-', 'https://www.unitedworldschools.org/transforming-lives-uws-ka-narng-ket-school/', 'transforming the lives']);" title="Transforming Lives at UWS Ka Narng Ket School">transforming the lives</a>

    Having had a dig around in the code, I think it is coming from function “output_parse_link”

    It looks like the “internal-as-outbound’ condition is being fired with a blank label, even though “Set path for internal links to track as outbound links:” and “Label for those links” are empty.

    case 'internal-as-outbound':
    					if ( ! is_null( $options['track_internal_as_label'] ) ) {
    						$label = $options['track_internal_as_label'];
    					} else {
    						$label = 'int';
    					}
    
    					$onclick = "_gaq.push(['_trackEvent', '" . esc_attr ( $link['category'] ) . "-" . esc_attr ( $label ) . "', '" . esc_attr ( $full_url ) . "', '" . esc_attr ( strip_tags( $link['link_text'] ) ) . "']);";
    
    					break;

    Thanks
    Hugh

    https://www.ads-software.com/plugins/google-analytics-for-wordpress/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Internal links being tracked as outbound-article- (with trailing dash)’ is closed to new replies.