Metadata and ref=<parameter>


(Anish Duggal) #1

Is it possible to trigger a specific bot or flow using the ?ref=?

How do I call the parameter from metadata? I looked into data outputs guide and got totally confused.

Thanks


(John Jackson) #2

You’d need to have a catch-all flow, and add a ‘Flow > Trigger a Flow’ action. This should trigger the flow that you want to start.

Then on the filter step of that action, add a filter like this:

{{metadata.ref}} is the value “foo” (assuming you were looking for …?ref=foo)

(To type in {{metadata.ref}} you’ll have to click the pencil icon to edit the filter field on the left).

Tick the option to ‘Also stop rest of flow if conditions are met’.

Now, when …?ref=foo, your other flow will trigger.


(Anish Duggal) #3

Thanks will test it and get back to you.


(Anish Duggal) #4

Already confused…

Ok so

?ref=foo

Flow 1
Flow - Catch All
Bot- Specific bot should listen
Filter - none

Action
Trigger a flow
Response path - Should it be set to Respond to Catch-All?
Word or Phrase - foo
Metadata - none added
Filter - {{missing output}} This is where I’m getting confused. Do I use {{catchall.metadata.foo}} = foo or {{catchall.metadata.ref}} = foo. Both of these default to {{missing output}}

Thank you for your help in advance.


(John Jackson) #5

No problem, you’re not far off!

You need the format {{catchall.metadata__ref}} (note the double underscore). If you look at the log, you should see the metadata output contains a ref property. You access properties like that using double underscore.

Also BTW, check the docs here and look for the referral links section so you understand when to expect a ref property (it’s different for when a bot is first started to when a user comes back to the bot with a referral link). The difference might not matter to you.


(Anish Duggal) #6

Thank you @johnjackson,

I was able to get it to work with those that have already messaged the page. For those where is is the first time and they see the ‘Get Started’ button the bot defaults to the get started flow instead of starting the ‘foo’ flow.

I figure I need to do some filtering here. Any suggestions?

The goal is to have different flows run for different incoming URL/ref.

Thnaks


(Khashayar) #7

There should be an option to mark a flow as a Get Started flow.

Currently, we can have a text-only get started message, which limits the kind of onboarding we can do. If we had a system to connect a whole flow to that button, it would be great.

That would also allow us to switch between on-boarding flows by just ticking a check-mark. Every flow with a “Bot” trigger would be capable of becoming an on-boarding flow, with one on-boarding flow active at any given time.


(Karen Barker) #8

Hi Khashayar,

You could use a flow keyword trigger word start to do this. This would then trigger on the get started message and could be used as an on-boarding flow. :slight_smile:


(Roman Shlyapkin) #9

Hi,

I do exactly the same things, thats are written here: Catch all, {{catchall.metadata__ref}}; but it’s not working. Could you please help me to catch ref parameter? I use the link t.me/name_bot?ref=123 , but in the log I see only this:

Message
/start
Message Type
direct_message
Attributes
{}
Metadata
{}


(Karen Barker) #10

Hi @Roman_Shlyapkin,

Everything looks correct there. What plaftorm are you trying to achieve this on? We do have a problem on the Web Messenger sending in metadata currently that the development team are working to fix ASAP. Could this be the cause?


(Roman Shlyapkin) #11

Hi @KarenBarker
I use telegram


(Karen Barker) #12

Hi @Roman_Shlyapkin,

Ah…unfortunately we only support sending metadata in on the URL for either Facebook messenger or the Web Messenger. :frowning: