• Logged in users should have the possibility to share a post in social media. Right now I am using the Jetpack plugin with the integrated Sharedaddy function. However, I am not able to add an referral Link to the shared post-url in order to track the user who shared the post.

    share url is http://www.example.com/post but I want to share this url with referral link http://www.example.com/post/?ref=user-a

    Does anyone know a solution with sharedaddy? I there another plugin? I don’t need the Jetpack plugin. I am only using it for the share function.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Right now I am using the Jetpack plugin with the integrated Sharedaddy function.

    Do you mean this Sharedaddy plugin which was last updated 5 years ago? Or what am I missing? Or is the functionality built in Jetpack and the plugin abandoned?

    Thread Starter mokorana

    (@mokorana)

    It’s version: 0.3.1 and directly integrated as a module in jetpack. I am using this because in my theme (Jobify) it’s also integrated as sharing plugin.

    Moderator bcworkz

    (@bcworkz)

    You can place the share link directly on a theme template file, using PHP to supply the appropriate post name and user login. No plugins required. Consider using a child theme though. Example to share a post on Facebook (untested):
    <a href="https://www.facebook.com/sharer/sharer.php?u=example.com/<?php global $post; echo esc_url( $post->post_name . '/?ref=' . wp_get_current_user()->user_login ); ?>">Share on Facebook</a>

    This assumes only logged in users use this link, otherwise getting the current user login will cause PHP errors. Code must be within the Loop. Situations not fitting this can be accommodated with some additional code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to track sharing to a user for a post’ is closed to new replies.