Anyone getting referral codes into their bot?

distribute
feature_request

#1

Hey bot makers!

Has anyone successfully implemented the use of referral codes.

For now, I use Viral Loops. If an invitee clicks a link, my site opens with a unique referral code in the URL. However, I can’t fetch that code from the bot output. Thereby the referrer will not get the award that he or she rightfully should.

Have anyone solved this or is there someone who is using another referral system than Viral Loops, which integrates better with Tars?

All ideas and input will be highly appreciated.

Thanks!


#2

Hi @Thomas,

The referral code that you added, is it added as a URL parameter in the URL?
Can you share the webpage where you have added the widget with the referral code in the URL, I’ll take a look.


#3

Hi @vinit

Sure, the URL looks like this: https://scribobot.com/?referralCode=HJv5M0BrG&refSource=email

HJv5M0BrG is the ID of the referrer and I need to get that info into the bot, so I can attribute the referrer his/her points for a successful referral.
:face_with_raised_eyebrow:

Thanks!
Thomas


#4

Got it, You want the URL param of the parent page on which the bot widget is there.
Currently this data is not available from within the Bot, but it would be easy to include it.

Let me see, what’s the best way to include this data


#5

Many thanks @vinit, would be awesome. Also for campaign tracking with UTM URLs and so on :wink:


#6

Got it.
BTW, I just made a video about using the URL param for tracking where the submissions is coming from. Nothing new here, but still thought i’ll just put it here for others to check:


Tracking External Links clicked on from within the Chatbot
#7

Great @vinit - and many thanks for looking into it!

However, I have this URL, which I think follows the structure you explain in the video:
https://cl.ly/0p1B1l2B1T26

But… in the bot ‘partial data’ output I don’t get the referral code:
https://cl.ly/3Q2z3X3a2l1R


#8

@vinit, I tried again, same outcome - could it be that this solution does not work with the ‘speaking bot’ option? I mean, even though this is the displayed URL (https://cl.ly/453J0K012K1L ), maybe there is the underlying ‘speak URL’ which cause the problem, as I see this in my ‘partial data’ section: https://cl.ly/3x0O3d3j1w2O
Please, let me know what solution you suggest in this case :slight_smile:


#9

Hey Thomas,

The URL param that you are adding is in the URL of the parent page where the bot widget is added, and not in the URL of the Chatbot itself. That’s why they are not coming in the submissions.

For that you need to add those params in the code snippet, but that would mean that you need to make that change in the page html containing the code snippet in a dynamic way.

Why don’t you ping us on the live chat on the TARS Dashboard, and we will find some solution.


#10

Is it possible to reference the URL parameters in an API call? For example if we were using the GET to pull data from a Google Spreadsheet, is it possible to make that call if the I added ?ref=49383 to the bot URL and then added SELECT A, B, C WHERE A={{urlp.ref}}?

I tried it once and it seemed to work (I thought), but I couldn’t replicate it. I was experimenting with three different bots doing variations of the call, so I could have mixed it up.


#11

Try this instead:

SELECT A, B, C WHERE A=’{{urlp.ref}}’

when the value to compare is a number, this might be needed. I am not sure, will have to check.


#12

Still getting this error message when debugging “Error in template eval code: var r=[];r.push(this.pre.fetch.table.rows[0]);return r.join(”");"

This is the link I’m experimenting with: https://mvd.hellotars.com/conv/SyTXqP/?ref=10845
It seems like it’s having trouble pulling the number from the URL parameter.

I have used this code repeatedly in other experiments with success just to weed out any foolish errors on my part haha.

This one in particular is SELECT A, B, C, D, E, F WHERE D={{urlp.ref}}


#13

I worked through it and figured out the problem. It was an issue with my columns in the Google Sheet itself and not the url parameters. I just spent two hours chasing my tail for the simplest mistake ever :confounded:


#14

Great. You figured it out.
That happens sometimes, when debudding issues like these. :smile:


#15

Can you please do a walkthrough video tutorial of all the steps


#16

Hey @Starkiss,

This is the video tutorial for the same. Are you looking for something else?


#17

I understand the example for adding tracking code to the bot URL itself but do we have a way to add tracking code for embedded bots?

Example: I send clients through a Google ad to a landing page called landingpage.com/?google-ad-tracking-code-that-I-want

They interact with a bot embedded on that page. But I want to see the tracking code when the interaction is emailed to me - so I can neatly track my ads and conversion rate with the bot.