Experiencing problems? Try these troubleshooting steps.

Track the page source of embedded videoasks

Have you embedded your videoask across multiple pages on your website? Wouldn’t it be useful to know exactly which page your respondent was on when they interacted with it?

If you’re on a paid plan, you can use custom variables to track which page your responses are coming from.

Jump to:

Use custom variables to track the page source of your videoask

Add the page source automatically to your widget

Add the page source automatically to your iframe

Use custom variables to track the page source of your videoask

Create a custom variable for your videoask URL and replace the placeholder information with your page name.

1

From your VideoAsk account, click the Share & Embed icon on your videoask.

2022-11-09_13-53-04.png

2

Click + Variables.

Source_page02.png

3

Select Add custom variable.

Source_page03.png

4

Choose a name for your variable and click Save. In this example, we’ll name the variable “source”.

Source_page04.png

Note: Custom variables must be alphanumeric, and you must_use_underscores_to_separate_words.

5

Click the Widget or Embed tab for the code.

Source_page05.png

6

Click Copy code. You’ll use this code to embed your videoask on your website.

Source_page06.png

7

Paste the code into a page on your website.

Source_page07.png

8

Next, go back to your VideoAsk account and click the Link tab.

Source_page08.png

9

Click Copy under Share your URL. This URL includes the variable you’ve added.

Source_page09.png

10

Then, go back to your website builder. Replace the URL in the embed code with the updated URL that includes your variable.

Source_page10.gif

11

Replace the variable placeholder (xxxx) with the page name on your website and you’re good to go! 

Source_page_11a.pngSource_page11b.png

Repeat steps 6-10 for each page you’d like to embed your videoask on. Make sure to replace the variable placeholder information with the specific page name.

12

Now, when a respondent answers your embedded videoask with variables, the page name will display with their response when you hover over the symbol.

Source_page12.png

Add the page source automatically to your widget

If you’re embedding a videoask widget across multiple pages on your website, you can add a little bit of code magic to automatically pull your page name into the variable. Follow the steps below to learn how.

1

From your VideoAsk account, click the Share & Embed icon on your videoask.

2022-11-09_13-53-04.png

2

Click + Variables.

Source_page02.png

3

Select Add custom variable.

Source_page03.png

4

Choose a name for your variable and click Save. In this example, we’ll name the variable “source”.

Source_page04.png

5

Click the Widget tab.

Source_page13.png

6

Choose the Widget style, Position (left or right), and Color.

Source_page14.png

7

When you’re happy with your widget design, click Get the code.

Source_page_15.png

8

This is the code you’ll use to embed your widget. Click Copy code.

Source_page16.png

9

Then, paste the widget code into a page on your website.

Source_page17.png

10

Copy the code below and paste it under <script> in your widget code. 

const pathname = window.location.pathname;

Source_page18.png

11

Next, head back to your VideoAsk account and click the Link tab.

Source_page19.png

12

We’ll need to grab the VideoAsk URL with the variable. Click Copy under Share your URL

Source_page20.png

13

Replace the URL in your embed code with the updated URL that includes your variable.

Source_page21.png

14

Delete the variable placeholder (xxxx) and type + pathname after your videoask URL. This will automatically pull your page name as the variable.

Source_page22.png

15

That’s it! You can now copy the new widget code you’ve created and paste it into any page on your website. The page name for your variable will be dynamically populated.

When a respondent answers your videoask widget, you’ll see the page name with their response when you hover over the symbol.

Source_page23.png

Add the page source automatically to your iframe

If you’re embedding an iframe across multiple pages on your website, you can add a little bit of code magic to automatically pull your page name into the variable. Follow the steps below to learn how.

1

Copy the custom code below and paste it within the <body> tags of the HTML on your website.

<script>

const pathname = window.location.pathname;
var iframe = document.createElement('iframe');
iframe.setAttribute('id', 'iframe');
iframe.style.width = "640px";
iframe.style.height = "480px";
iframe.style.border = "none";
iframe.allow = "camera *; microphone *; autoplay *; encrypted-media *; fullscreen *; display-capture *;"

document.body.appendChild(iframe);

iframe.setAttribute('src', 'YOUR_VIDEOASK_URL_HERE#source=' + pathname, 'allow', '"camera *; microphone *; autoplay *; encrypted-media *; fullscreen *; display-capture *;"', 'width', '"100%"', 'height', '"600px"', 'style', '"border: none; border-radius: 24px"');

</script>

Source_page24.png

2

Back in your videoask account, click the Share & Embed icon on the videoask you would like to embed.

2022-11-09_13-53-04.png

3

Click +variables.

Source_page26.png

4

Select Add custom variable.

Source_page27.png

5

Choose a name for your variable and click Save. In this example, we'll name the variable "source".

Source_page28.png

6

Click Copy to copy the videoask URL.

Source_page29.png

7

Next, replace the videoask URL placeholder in the custom code with the videoask URL you've copied from step 6.

Source_page30a.pngSource_page30b.png

8

Delete the placeholder (XXXX) from the videoask URL. 

Source_page31.png

9

If you'd like to adjust the size of your iframe, you can edit the pixel size next to iframe.style.width and iframe.style.height.

Source_page32.png

10

That's it! You can now copy the new iframe code you've created and paste it into any page on your website. The page name for your variable will be dynamically populated.

When a respondent answers your videoask, you'll see the page name with their response when you hover over the symbol.

source_page33.png

💡 Tip: Export your responses to a .csv or .xlsx file to analyze them. Information collected from your custom variable will be included in the file.

Can't find what you're looking for?