Inserting URL or Page Title into Google Sheets

(Mitch Smith) #1

Hopefully, this isn’t a facepalm but I have looked all over and am not finding direction on this.

I am running the same bot on many landing pages and want the bot to report what page the conversation came from. Any kind of ID specific to the page would be great - something like a URL or page title would be ideal.

Any direction on this? Thank you

(Karen Barker) #2

Hi Mitch,

I presume this is using the Web Messenger on different landing pages? How are you launching the Web Messenger - URL, iFrame, Web Widget?

If you’re using the URL or iFrame then you could pass the page URL in as reference data on the URL. This will then be accessible on the metadata that you can reference and store in Google Sheets.

If you’re using the Web Widget then you’ll need to take a look at our API and use the sendMessage option to pass metadata to the bot.

I hope this helps. :thumbsup:

1 Like
(Mitch Smith) #3

Hello,

Yes, I am using the Web Messenger web widget. I definitely appreciate the direction.

If anybody has further direction on the exact implementation of this that they care to share I would greatly appreciate.

If I figure it out in the meantime I will post it back here.

Thank you

(Sarah Palombo) #4

Hi Mitch :wave:

There’s a nice little example in the docs
Just under sendMessage(text, metadata)

Any custom metadata specified in the metadata parameter will be added to the message and can then but used in your flow.

// Send a simple message
FxoMessenger.sendMessage(‘Hey!’);

// Send a message with metadata
FxoMessenger.sendMessage(‘Hey!’, {
user_id: 12345,
name: 'John Doe’
});

Let us know how you get on & hope that helps !

Sarah :slight_smile:

(Mitch Smith) #5

I feel silly asking but what is the parameter I am looking for to get the current page URL? I think it gets me close!

(Daniel Beckett) #6

Hi Mitch,

If you’re using JavaScript on your page this might help.

1 Like