How to Implement Share Pages on my App

A shared page is the place where you allow your advocates to refer your services on social media (Facebook, Twitter, Google +, Linkedin, Pinterest, Emails, Personal URLs, etc.) (step 6 on AIM). The idea is to have a place where they can share their share links. 

We are using here the Genius Referrals referral marketing program as a use case to help you to understand and teach you how to implement your own referrals marketing program.  

As you can see below our Referrals tools allow our advocates to refer our services using several resources. Our advocate's can refer us using social networks, emails, personal URL and even use a QR code that they can print anywhere they want. 

Genius Referrals tools

To implement this page in your application or Website you need to get the advocates share links for each referral origin from the Genius Referrals Platform. This means that you must have already registered the advocate in the Genius Referrals Platform and that the advocate is logged in your system. If you have not done this yet please read this also you might want to check out our Case Studies for a full detailed example.

Also, we have two sample application where you can see and integration in action. Download this sample apps here

Once the advocate is logged in your system you can get the share links using one of our SDKs and populate the share links as you want in your application. You can use links, QR code, etc. 

There are two ways you can use to get the share links for and advocate and publish them in your custom refer a friend page. The first method is to build your advocates share links by yourself by taking the information from the widgets packages page and the second is to get the share links using an SDK or our RESTful API directly. Using the SDK to get the advocate's share links is very easy, we have implemented a method you can use for this purpose. You just need to know the advocate_token, the campaign and the widget package you want your advocates to share. Check out the reference documentation for more details. 

Example using the PHP SDK: 

    /*
     * On your action method just do something like this
     */

    //the advocate token of the customer that is logged in
    $strGRAdvocateToken  = 'cc6bdb82850654d89bebada2b52e80289b098c1d3'; 
    
    // Create a new GRPHPAPIClient object 
    $objGeniusReferralsAPIClient = new GRPHPAPIClient('YOUR_USERNAME', 'YOUR_API_TOKEN');

    $strResponse = $objGeniusReferralsAPIClient->getAdvocatesShareLinks('genius-referrals', $strGRAdovocateToken);
    $intResponseCode = $objGeniusReferralsAPIClient->getResponseCode();
    if($intResponseCode == 200){
        $objResponse = json_decode($strResponse);
    }
    else{
        // handle errors
    }

Once you have gotten the share links using the SDK you can parse the data and get the share URL for each network. Then build your share links according to your needs. 


Resource Extension Size



Please leave your comments/questions below