Home » Topics » General Support » Having an issue with Yoast Analytics outbound link tracking

Having an issue with Yoast Analytics outbound link tracking

ACF Widgets Support General Support Having an issue with Yoast Analytics outbound link tracking

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3397
    Josh Guss
    Participant

    Hey-

    Not sure if this falls under this support forum but one of my client’s sites uses Yoast Analytics to generate the outbound link tracking code for any outbound links for Google Analytics. This seems to work properly with basic built in widgets in WordPress (i.e. the Text widget) but it does not seem to pickup these outbound links when they are used in custom ACF Widgets. I am guess this has to do with a filter thing but not sure so figured I would post here to see if you had any thoughts.

    Thanks,

    Josh

    #3398
    Daron Spence
    Keymaster

    Hey Josh! Thanks for renewing your subscription the other day 🙂 I really appreciate your support w/ such high traffic sites! 😀

    It looks like Yoast Analytics hooks into the widget_text filter and searches for links and adds the necessary markup. So you should be able to do something like…

    
      <?php $html = "<a href='#'>My link</a>";?>
      <p><?php echo apply_filters( 'widget_text', $html ); ?></p>
    

    You should be able to play around with it and get it to work using the above method.

    Let me know if that works for ya!

    #3402
    Josh Guss
    Participant

    Hey Daron,

    Thanks! This is exactly what I needed to get this working properly. Take care.

    Josh

    #3476
    Daron Spence
    Keymaster

    Marking as closed.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Having an issue with Yoast Analytics outbound link tracking’ is closed to new replies.