Testing Web Referrals
We elaborate on the right approach to testing the web integration.
While much of the Testing Guide is truly written with a focus on guiding you, you should make note that covering all use cases is virtually impossible.
Please take your time to read the entire Testing Guide. It should answer all your questions.
If you do not get an answer to any of your questions, reach out to us.
Register web user as soon as the user signup in the application using the API Register Web User . I am triggering Register Web User api using email “sureshana802@gmail.com”.
Input i.e. Request
{ "apikey":"004d37de619e41888eb7a4f800715468", "privatekey":"0ef86e6ee69047abb18aa50900554688", "userkey": "", "EmailId":"sureshana802@gmail.com", "AppUserName":"", "ProfileImage":"", "UserIdInstore":"", "city":"", "country":"", "state":"", "Phone":"", "isExistingUser":"", "avClick":"", "ReferrerCode":"" }
Response
{ "userkey": "aa1f7b510ae4d7c8a5a58c1de1edfc9192", "shareurl": "http://apvi.co/momg295-14l", "referralcode": "momg295", "isExistingUser": false, "hasReferrer": false, "success": true, "statuscode": 1, "message": "Success" }
When you register a new user you will see “isExistingUser” and “hasReferrer” parameters in the response as false. If you try to register an existing user then “isExistingUser” parameter will be true and the user will not be registered again. referral code, share URL and user key will be generated for this new user.
Now you can find the registered user under Analytics–> Influencers tab.
Once after registering a new user then the user can referrer his friends by sharing the referral link or referral code. Friend can click on referral link or can enter referral code while signup based on the attribution setting configured for your application.Following is the detail for each type of attribution setting.
1.Link based attribution:
If attribution setting is only referral link then the friend has to click on the referral link for successful attribution. If friend doesn’t click on referral link but enters referral code while signup then attribution will not happen.
Input i.e. Request
{ "apikey":"004d37de619e41888eb7a4f800715468", "privatekey":"0ef86e6ee69047abb18aa50900554688", "userkey": "", "EmailId":"peter.raj990@gmail.com", "AppUserName":"", "ProfileImage":"", "UserIdInstore":"", "city":"", "country":"", "state":"", "Phone":"", "isExistingUser":"", "avClick":"12yhs7", "ReferrerCode":"momg295" }
Response
{ "userkey": "aa445df0bed8637ab0e17ab158055f092e", "shareurl": "http://apvi.co/momg298-14l", "referralcode": "momg298", "isExistingUser": false, "hasReferrer": true, "success": true, "statuscode": 1, "message": "Success" }
Friend clicked on referral link, now when signs up you should trigger register web user api with friend email, avClick and referrer code parameters. Now attribution will be successful. you can see the “hasReferrer” parameter as true which means the user “peter.raj990@gmail.com” has the referrer.
If attribution fails then we will show the reason in the “message” parameter of the register web user response.
Now you can find the referrer and friend details under Analytics–> Influencers tab.
2. Code based attribution:
If attribution setting is only referral code then the friend has to enter referral code while signup for successful attribution. If the friend doesn’t enter referral code while signup but clicks on referral link before signup then attribution will not happen in this case.
Input i.e. Request
{ "apikey":"004d37de619e41888eb7a4f800715468", "privatekey":"0ef86e6ee69047abb18aa50900554688", "userkey": "", "EmailId":"mnn.madhu@gmail.com", "AppUserName":"", "ProfileImage":"", "UserIdInstore":"", "city":"", "country":"", "state":"", "Phone":"", "isExistingUser":"", "avClick":"", "ReferrerCode":"momg295" }
Response
{ "userkey": "aaafd4dd6f08a35f2a537b5a432ca701c5", "shareurl": "http://apvi.co/momg299-14l", "referralcode": "momg299", "isExistingUser": false, "hasReferrer": true, "success": true, "statuscode": 1, "message": "Success" }
Now you can find the referrer and friend details under Analytics–> Influencers tab.
3. Link + Code based attribution:
If your attribution setting is referral link + code then attribution happens when you click on referral link or when you enter referral code while signup. this will be the default attribution setting.
Once the attribution is successful then you can trigger Register Conversion Event API to distribute the rewards to users based on the campaign. If you have configured rewards to referrer and friend on friend transaction then users will get rewards when the friend does a transaction.
Input i.e. Request
{ "apikey":"004d37de619e41888eb7a4f800715468", "privatekey":"0ef86e6ee69047abb18aa50900554688", "userkey":"", "emailid":"peter.raj990@gmail.com", "transactionvalue": "500", "growthhack": "", "campaignId": "", "tskey": "1311111", "eventname": "transaction", "UserIdInstore":"", "extrainfo": "" }
Response
{ "success": true, "statuscode": 1, "message": "Success" }
You can trigger register conversion event api using friend userkey or emailid or useridinstore with minimum transaction value configured in the campaign. Once the conversion event is successful, you will see “success” as true in the response . if it fails then you will see the reason for failure in the ” message” parameter.
You can see the rewards for users in both referrer and friend rewards tabs. If the reward configuration is coupons then rewards will distribute based on coupons configured. click here for the help document on how coupons distribute.
If the Reward configuration is Wallet then rewards will be distributed to users and the status of the rewards will be approved.
Now you can change the status of the reward to rewarded from dashboard or by using Change Reward Status API.
You can also find the attribution and reward distributed details in the query resolution and you can invoke conversion event from the query resolution by clicking on invoke button.
If you want to reuse the email id then you can add the email id to the test device using addtestdevice api. It is mandatory to click on “Add Test Device” button in the AppVirality Dashboard >> Testing page before you execute this call. It will give a window of 30 sec to register the email for testing.
POST /v2_0/addtestdevice
Content-Type application/json
{ "apikey":"004d37de619e41777eb7a4f800715468", "privatekey":"0ef86e6ee69017abb18aa50900554688", "email":"sureshana802@gmail.com" }
{ "success": true, "statuscode": 1, "message": "Success" }
Output Params | Description |
---|---|
success | returns true on successful execution |
message | Information regarding API call (if relevant) |
Email id “sureshana802@gmail.com” will be added in test devices. now you can click on reset to reuse the emailid for testing.