Affiliates – Shortcodes

The information on this page is outdated. Please refer to the Documentation..

Note: From release 1.3.1, you can go to Affiliates > Options and press the Generate button which will create the default Affiliate Area.

For complete details on shortcodes please visit the Shortcodes section in the documentation.

Information for affiliates

Affiliate link

Embed this shortcode on a page:

[affiliates_url]

This will render a link to your site with the affiliate ID appended.

If you want to link to a certain page, you can use this shortcode:

[affiliates_url]http://www.example.com/somepage[/affiliates_url]

If you want to show how a link would look like, you can use the shortcode within HTML as well, for example:

<a href=”[affiliates_url]”>[affiliates_url]</a>

Remember to use HTML entities for < and >.

Affiliate earnings & performance

Your affiliates will want to know how much they will and have earned and how many referrals they have made.

Use the [affiliates_referrals] shortcode to show how many referrals an affiliate has made and how much the affiliate has earned.

The [affiliates_referrals] shortcode will show the total number of referrals that have been accepted or closed for the affiliate.

To show the number of referrals for an affiliate by status, embed it like this:

Examples:

– Accepted referrals: [affiliates_referrals status=”accepted”]
– Closed referrals: [affiliates_referrals status=”closed”]
– Pending referrals: [affiliates_referrals status=”pending”]
– Rejected referrals: [affiliates_referrals status=”rejected”]

If you add the show=”total” attribute to that shortcode, it will make a list of earnings by currency:

Examples:

Total amount for paid and unpaid referrals: [affiliates_referrals show=”total”]

– Total for unpaid referrals: [affiliates_referrals show=”total” status=”accepted”]
– Total for paid referrals: [affiliates_referrals show=”total” status=”closed”]
– Total for referrals pending approval: [affiliates_referrals show=”total” status=”pending”]
– Total for rejected referrals: [affiliates_referrals show=”total” status=”rejected”]

Content visibility

* Embed the content that you want to show to affiliates like this:

[affiliates_is_affiliate]

This is visible to affiliates who are logged in only.

[/affiliates_is_affiliate]

* For content to show to non-affiliates use this:

[affiliates_is_not_affiliate]

You can see this if you are not logged in as an affiliate.

[/affiliates_is_not_affiliate]

Login and Logout

Use the following shortcode to allow users to log in and remain on the same page after having logged in. This shortcode also accepts an optional redirect_url attribute to redirect the user to a different page after logging in.

[affiliates_login_redirect]

[affiliates_login_redirect redirect_url=”http://www.example.com/where-to-redirect/”]

Use the following shortcode to embed a Log out link on a page:

[affiliates_logout]

Affiliate Registration

Shortcode tag

[affiliates_registration /]

Usage

Lets visitors sign up to your affiliate program in a fully automated process.

Attributes

is_widget

Must be set to true if the shortcode is used in a widget.

default: false

registered_profile_link_text

Profile link text to be displayed for registered users after signing up for the affiliate program.

registered_profile_link_url

Profile Link for registered users after signing up for the affiliate program.

redirect

Whether to redirect after registration.

default: false

redirect_to

Redirection URL.

terms_post_id

ID of the post with affiliate terms and conditions.

Notes

This feature is also available as the Affiliates Registration widget.

Affiliates Pro provides additional shortcodes for affiliate links, banners and stats.


Comments

117 responses to “Affiliates – Shortcodes”

  1. 3mpstudio Avatar

    Hi, can I use a page from a different domain to link that affiliate URL? Will it record the visit of the referral?
    For example:
    Affiliate and WooCommerce is setup at domainA.com
    But the sales page is at domainB.com/salespage
    Should i use this short code?
    [affiliate_url]http://domainB.com/salespage[/affiliate_url]

    Is that correct? Will it record the referral even it’s on a different domain? thanks!

    1. Hi,

      No that would not work, the affiliate links need to point to the domain where the affiliate system is running.

      Cheers

  2. Hi there,

    The shortcode [affiliates_url] doesn't work. When placed in front of a link and [/affiliates_url] placed after the link, the link is not rendered on the page. Just empty space.

    1. Hi Richard,

      If the content within the enclosing shortcodes is empty, this would be because you are not logged in as an affiliate. Try to view the page where you have placed it using an affiliate user account please.

      Cheers

  3. Hello, Can you tell me if there is a way to change the parameter of the user ID to a higher number? I’d rather not start off at 2 for my ID number. Thank you.

    1. Hi Sue,

      The IDs are generated automatically and can’t be changed but you can create dummy accounts manually before adding affiliates.

      Cheers

  4. Sir i am posting this code in pages or post like that [referrer_id] and this is not working showing blank space

    1. Hi,
      you could try:
      1.- Enable debugging for WordPress, in wp-config.php add/change these lines:
      define( ‘WP_DEBUG’, true );
      define( ‘WP_DEBUG_LOG’, true );
      2.- Visits the page that generates the error.
      3. Disable debugging
      define( ‘WP_DEBUG’, false );
      define( ‘WP_DEBUG_LOG’, false );
      4. Please post the contents of the file wp-content/debug.log through pastebin.com
      cheers

  5. Abdul Wahab Avatar
    Abdul Wahab

    How to use this [referrer_id] is not working and i dont know how to call it Affiliates_Service::get_referrer_id().

    1. If your need to use the shortcode:
      – In a Page/Post simply: [referrer_id]
      – In PHP code, you can use do_shortcode: echo do_shortcode( ‘[referrer_id]‘ );
      cheers

      1. Abdul Wahab Avatar
        Abdul Wahab

        but this code is not working showing blank space

        1. Be ware with copy-paste, be sure you are using the correct commas (‘)

  6. Hi just one more thing, when using affiliate the following shortcodes are not working

    [affiliates_affiliate_stats]
    [affiliates_affiliate_graph]

    Is this because it’s the standard version and not the pro version.

    1. Hi,
      yes, the advanced shortcodes are available in Pro and Enterprise versions.
      cheers

  7. Also if I purchase Affiliates pro do I get gravity plugin and Social Share plugin included?

    1. No, these are separate.

  8. Hi I am testing the affliates standard before I purchase the pro version sometimes i will have to manually enter in orders taken over the phone and via enquiry forms, I tried to add a new referrals but when I press save it doesnt add the new referral have disabled all plugins.

    Any advice on what the problem could be

    thanks

    1. Hi Jay, it might be because you try to record a referral that the system identifies as a duplicate of an existing one. Please try to use a unique Reference in the field available for that purpose.

  9. Note: other shortcodes are working fine

  10. Hello,

    When I use the shortcoe: [affiliates_login_redirect]

    It doesn’t show anything when I use internet Explorer 11..

    Its just blank where the login form should be.

    Its works fine from other browsers.

    Any idea how to fix this?

    1. Hi,
      please give us an url to have a look.
      cheers

        1. Hi,
          I have tested the website in IE 11.0.8 and I can see the page correctly.
          Probably it is a problem with your theme in your IE version. You could try to clear the browser cache.
          cheers

  11. Hi Kento and team,

    I am running into issues with my login fields under my affiliate area. After entering the login credentials,I am automatically routed back to my main page and not into the affiliate’s detailed page (that shows performance,etc.) How would I go about fixing this? I am using Affiliates Pro, WooCommerce Integration, and Affiliates by Username.

    Thanks!

    1. antonio Avatar
      antonio

      Hi,
      you can use [affiliates_login_redirect] shortcode in your affiliates-area page.
      cheers

      1. Hi Antonio, I have LockerPress plugin installed to have a custom URL login to prevent my wp-login/wp-admin from getting attacked (which happened before) When I have the plugin turned off, everything works fine, but with the custom URL on, the [affiliates_login_redirect] shortcode does not work. What do you suggest? I don’t think I want to remove the Lockerpress, just want the shortcode to work alongside Lockerpress. Thank you!

        1. Hi Jie,

          It seems that these are incompatible, but if LockerPress allows you to redirect to a page, you could use the [affiliates_is_affiliate] shortcode to offer a link to affiliates. Would that be an option?

          1. Sure, that would be an option. I tried to use this shortcode [affiliates_login_redirect]
            Example:
            [affiliates_login_redirect redirect_url="http://www.example.com/goto/"]

            previously too, but did not have success. I don’t mind not using lockerpress and can use an alternative plugin.

            Thanks again for the help!

  12. Something more with multi tier integration i gues.
    So the affiliate gets commsion over an affiliate and that affiliate gets an commision to an the affiliate of the affiliate of the affiliate to. so its like multi level signup integration.

    Is that correct that it works like this with commision rate?

    1. For multiple tiers you would need Affiliates Enterprise, you can set rates per tier with that version.

  13. Hello,

    How can i earn the commission of the refferals refferal.
    Where can i find something like that or integrate that.

    So the affiliates get 5% earnings from the affiliate?

    Is there a way to fix this?
    I cant find it anywhere, sorry i am dutch!

    1. Hi Juri,

      You can use the free Affiliates plugin with one of the free integrations for that. They allow you to set a commission rate and will record commissions on referred sales.

  14. Hi

    [referrer_user] is not working , want to show the name, username and email address of each referral, and whether they are Pending or Closed

    1. When you say not working, how are you using the shortcode? Note that you can’t show referral data using it, see http://www.itthinx.com/documentation/affiliates/shortcodes/

  15. bucktastic Avatar
    bucktastic

    having same issue with no password showing up on registration page, but requires password when you sign up. also doesn’t show terms page and getting content not found error when you click on login or register buttons on the login screen…

    1. Hi,
      Affiliates uses WordPress registration system, so the password is sent by email.
      cheers

  16. This doesn’t show the steps to upgrade … Can you please give the steps specifically? Do we just deactivate and install ? or is there more to it than that?
    I keep getting Failed message.
    Unpacking the package…

    Installing the plugin…

    Destination folder already exists. /home/snapfire/public_html/getmybusinesscards.com/wp-content/plugins/affiliates-pro/

    Plugin install failed.

    1. antonio Avatar

      Hi,
      in your downloads page you have a README.txt file with the instructions.
      cheers

  17. This doesn’t show the steps to upgrade … Can you please give the steps specifically? Do we just deactivate and install ? or is there more to it than that?

  18. Hello. What is the process to make an upgrade from affiliate PRO to enterprise without losing existing data.

    Is there guide avaluable. if so please cna we have a link.
    Thanks

    1. Hi,
      please have a look to this conversation.
      cheers

  19. Hello! If I make update from pro to enterprise will all my data be saved. I mean will I lose all data that are stored in affiliate PRO if I upgrade. and one more question will cookie that are already stored in computers of potential clinets work with new upgrade.

    Thanks

    1. Hi,
      The data will not be lost, but
      1.- Always make a backup (files and database) before.
      2.- Be sure you have NOT selected “Delete all plugin data on deactivation” in Affiliates->Options.
      Cookies will work fine, if you don’t change “Affiliate URL parameter name” in Affiliates->Options.
      cheers

  20. Hi, I’m struggling to get my shortcodes to show correctly to the affiliate.

    I want basically to generate a banner link to a specific page for affiliates, but I can’t even get the basic shortcodes to work. I’m sure there is something that I’m not understanding, and that it isn’t the plugin 😉

    the pages are

    Affiliate sign up:
    http://lessfuel.co.uk/partners-area/

    and the links page, with the copied codes in, that don’t seem to work:
    http://lessfuel.co.uk/partners-links/

    any help or shortcodes appreciated please

    regards

    Mark

    1. i’ve been browsing around your site, and maybe the problem is that some shortcodes only work with pro? – I only have the basic plugin.

      But on your comparison page http://www.itthinx.com/affiliates-plugins-feature-comparison/ it does seem to say that a banner link to a specific page is possible …? Now I’m confused ….

      1. Yes sure, you can use the [affiliates_url] shortcode for that, there is an example on the Shortcodes documentation page on how to use it with a link. To make it a banner, simply add an image inside.

  21. Hello!

    For some reason my affiliate links are like this:

    http://www.mysite.fi?affiliates=2

    http://www.mysite.fi?affiliates=3

    Any idea why this is happening?

    1. Hi,
      That format is correct, what is the problem?
      cheers

  22. Hello.

    all my referrals are kept as direct.

    I access the site via http://www.example.com/affiliate?id=1 and then access the contact page (at this time was the affiliate id lost?) to ask informations.

    The referral is kept always as direct.

    What can be wrong?

    Regards

    1. The URL parameter is most probably wrong. The default is in the plural form affiliates and the URL you have posted is malformed. Check the documentation and generated affiliate area on how these are to be used please.

      1. Yes you´re right.. the url was mal formed. This is what i got from “Manage Affiliates” section:

        http://www.example.com/affiliates/4

        Yet, when I go to contacts page the url becomes

        http://www.example.com/contacts

        is the affiliates info suppose to disappear fro the url? All referrals still go to direct.

        Thanks

        1. You seem to have a redirection in place. Also, if you have a page sitting at http://www.example.com/affiliates – then this will conflict with the URL parameter. In that case, change that page’s slug or the URL parameter to something different.

          1. Hi, i have no page sitting at http://www.example.com/affiliates

            What is it about redirection? Some parameter I have to change?

            1. Can we have access to the admin section of your site to have a look please? Create an account for support at itthinx dot com please and we’ll have a look.

          2. If you mean the option Redirection, it is not checked.

            what can be wrong? Everything keeps going to direct.

            1. Thanks, I don’t think that option is related in this case.

  23. hi i would like to know if there are shotrcodes that can display:

    1. Name of user that bought the product
    2. Name of the bought product

    I think that it is not dificult to for software to retreive these data, and in case that this function is not avaluable is there any way to include them.

    Thanks

    1. Hi,
      please have a look to Affiliates Woocommerce Views plugin.
      Cheers

      1. Thanks. But this is working id I want to insert the name of the product ordered, and I want to display name of the buyer; name surname name of the company etc. Is this possible.

        1. Hi,
          you can add in line 100, for example:

          $output .= "" . $order->user_id . "-" . $order->billing_company . "-" . $order->billing_first_name . "";

          cheers

          1. I just wanted to complimet you for your fast answers and assistance.
            realy great service
            Thank You

            1. thanks 😉

  24. Hi,
    I would like to use affiliates shortcodes within this plugin: http://wordpress.org/plugins/insert-html-snippet/
    However they dont work. Also when using the “php echo do shortcode”-thing. The plugin’s author told me that the problem might be that affiliates plugin only supports Post Snippets’ shortcodes. Is that true?

    1. Hi,
      I suppose it’s true, if the author told you 😉
      If you need to add shortcode, this article may be useful.
      cheers

  25. Jame Duffell Avatar
    Jame Duffell

    Hi kento,

    Is it possible to gain access to the forum, as I mentioned previously, I purchased the plugin direct from Jigoshop, which is a pain in the bum as I’m missing out on lots of resources from yourself.

    I purchased the “Affiliates Pro Integration Pack” direct and have my order details as confirmation.

    Cheers,
    ^JD

    1. Hi,
      you have access to Jigoshop forum support.
      Don’t worry, you can use our comments system or JigoShop’s support forum (they redirect us issues).
      cheers

  26. James Duffell Avatar
    James Duffell

    Hi I have something which is driving me bonkers to work out. Rather than use affiliate URLs I’m looking at just using a shortcode.

    I can’t seem to figure out what the shortcode is to reference affiliate attributes, assuming this is really simple but could do with a pointer.

    Cheers,
    ^JD

    1. Hi James,

      Do you mean with Affiliates or Pro/Enterprise? With the latter, you have this section in the documentation which explains how these can be rendered. Please post a topic in the forums if you need any help with that.

      Cheers

  27. Thank you for checking this out for me- much appreciated! Is there any chance of a paid integration pluggin for WP Members (like the one you have for S2 members) in the future?

    1. sorry, but currently there is in the planning. cheers

    1. Hi,
      I have tried this and seems that Affiliates is incompatible with WP Members, sorry.
      cheers

      1. Incompatible if you enable extra field, in other case no.

  28. Hi there,

    I have installed the plugin and set up an affiliate registration page but when I try to fill it in to test, it seems to clash with my WP Members plugin registration form, as it is asking for required fields from the Members registration form (which don’t even appear on the Affiliates form. Could you please help me sort this out?

    Thank you for you help!

    1. Hi,please give us an url to have a look.
      cheers

  29. I would like to use the affiliate redirect shortcode and link the affiliate url to that. I tried the following but that does not work.
    It means nested shortcodes do not work. Can you think of any workaround ?
    [affiliates_login_redirect redirect_url=[affiliates_url]]

    1. Hi,
      you can not use shortcodes inside each other. If you want redirect to affiliate-area, you can use: [affiliates_login_redirect redirect_url="http://yourdomain.com/affiliates-area"]

  30. How can Sell will be automatically added to an affiliate? I don’t have any ecommerce plugin setup.

    1. antonio Avatar

      Hi,
      What e-commerce’re using? specific extensions exist for different e-commerce.
      cheers

  31. no your not understanding me I want the affiliates to be provided with there referrals details not there own details

    example:

    John brings lewis I want Lewis name and email to show to John on there affiliates area

    1. You can show referral stats using [affiliates_affiliate_stats] but with the s2 integration you will not be able to show what you have explained in the example.

  32. will that show all affiliates there refferals names and emails not show there own

    Mike

    1. Give it a try on a test page and visit it logged in as an affiliate, you’ll see the info presented by default. You can then fine-tune it using the attributes for the shortcode.

  33. I want to know what the shortcode would be for me to show the affiliates details to the affiliate like in a table that gives them there name and email

    Thanks

    Mike Sherratt

    1. I think you’re looking for the [affiliates_affiliate_profile] shortcode. See the section on Setting up an affiliate profile page for an example.

  34. ok thanks guys but i dont have affiliates pro so its not working anyway thanks for prompt reply ..

  35. Hi, I need to display list of referrals in frontend is there any shortcode for that?

    1. Please refer to the Shortcodes section in the documentation for that.

    2. Hi,
      It’s the [affiliates_affiliate_stats] shortcode.
      cheers

  36. I want to require affiliates to provide their website on signup. Currently it is not required just suggested. I need to be able to see the website when I manage the affiliates. Can you tell me how to do this please?

    1. Hi, please have a look at this comment where a way to derive a customized form is outlined as well as an alternative providing your own form.

  37. I am using “Easy Contact Forms” plugin. How would I track a conversion when the visitor hits the/thank-you page?

    1. The API documentation has a section on recording referrals, you can use it to capture the form submission event and record a referral based on the data.

  38. matteodini Avatar
    matteodini

    Hi,

    it’s possible visualize a default value like “EUR 0,00” when the [affiliates_referrals show="total" status="accepted"] doesn’t have any earning by currency ?

    I tried but the shortcode doesn’t display any value.

    Thanks !

    1. It’s not possible to do that, the shortcode is intended to show information based on existing referrals. But, it might be a good idea to add an option that shows some default text when the shortcode’s result would be empty.

  39. I’m using this with Jigoshop and the store is actually at /shop. How do I get the affiliate short codes to link to my website with the /shop on it?

    1. This is explained in the Shortcodes section of the documentation.

  40. Gravity forms allows inserting data into fields like this

    any idea how the code you shared might fit into an equation like that?

    1. Have you posted some code in the comment? If yes it’s been stripped off, please post in on pastebin for example and I’ll have a look.

  41. Is there any way I can include some code into a Hidden Field for Gravity Forms to allow me to track which affiliate the referral is coming from?

    1. You can obtain the referrer ID by calling Affiliates_Service::get_referrer_id(). I’ve not used Gravity Forms but suppose it would be quite simple to use the value for the hidden field.

  42. i have not a recently a screen shot but i will send u….

    1. Thanks, that will make it easier to help 🙂

  43. i put a registration affiliates form but i register new user than display error please enter password ? what i do for taht ?

    1. Does the email with the account details get through?

      1. yes than also it display error

        1. Please provide a screenshot of the error you get.

  44. I’ve installed and activated this plugin but I don’t see where I would set up the affiliate commission percentage. Where could I set the default commission rate, say 20% per sale?

    1. Install any of the free integrations available and you will have a section added to the Affiliates menu where you can set that.

  45. Hey Kento,

    You can check out my dutch affiliates page on http://bedrukjeeigenkerstbal.nl/affiliates.

    Three questions:
    1. Can I translate all the fields to a Dutch text?
    2. Can I personalize the e-mail my affiliates receive? I would like it to include a thank you message and their personal affiliates code.
    3. Will this url not interfere with the plugin?

    I just used the shortcode without any options. I will probably add those later.

    1. Hi Max,
      1 – Sure, this just needs a translation file to be added. If you know how to handle .po files I’ll forward a template or you can send me the fields’ translations.
      2 – Not yet, that might get added to a coming release though. Features get added as contributors help or if general interest is sufficient.
      3 – No the URL should not interfere.
      Hey the Xmas balls are a nice idea 🙂

      1. Hey Kento,

        Thanks for the reply.

        1. Can you send me the .po files? I have never done it, but I am sure I’ll figure it out and it will be nice to learn.
        2. I will make a template for the page where affiliates are send to and send the e-mail from there. Can I access Post or get variables on that page?
        3. Thought.

        And thank you. We sold 50 already and the dutch december spirit has started today, so I am hoping for a big success.

        1. Thanks Max for contributing with your translations.
          Take a look at class-affiliates-registration.php, you should be able to derive what you need from there for the template.
          Fingers crossed for Xmas sales 😉

  46. Hi where can I find documentation on the extended shortcodes for the pro version?

    1. I’ve just forwarded an outline to you while full doc is prepared. Thanks a lot for your support 🙂

  47. Registration is currently closed..how do i fix this?

    1. You need to allow people to register on your site: Go to Settings > General and tick Membership [x] Anyone can register

Share