us-southcarolina
.<head>
or <body>
section of your website’s HTML code.
<head>
or <body>
of your HTML. The location of the script determines when it will load. For best performance, place the script in the <head>
of your website’s HTML. If you place the script in the <head>
of your website’s HTML, the script loads before your entire HTML page body loads, along with any other scripts your <head>
may contain. The agent still only displays on the individual pages where you have also placed the HTML markup snippet in the <body>
.
The following example shows how to include the script in the <head>
. It includes one option for the HTML snippet to obtain the product ID, which is described in options to obtain the product ID:
<body>
of your website’s HTML. If you place the script in the <body>
of specific pages, the script loads only on the pages that contain the script, but the script loads after all the other scripts in your <head>
. Even in this case, the agent only displays if you have also placed the HTML markup snippet on that page’s <body>
. However, the order that you place the script and HTML markup snippet relative to other items on your page can affect the order in which other page elements load. For this reason, this placement is not the recommended one.
The following example shows how to include the script in the <body>
. It includes one option for the HTML snippet to obtain the product ID, which is described in options to obtain the product ID:
<lw-template>
HTML snippet must be present in the <body>
of a page in order for the agent to display.
<body>
of your webpage. There are three ways the agent obtains the product ID.
<head>
or <body>
section:
<lw-template>
HTML snippet in the <body>
of every page where you want the virtual agent to display.product-id
. For example, if your URL is https://www.example.com/sale?q=solvents&product=1234
and your product ID is 1234, enter product
.1234
from your CSS selectors without any additional text, such as product-id: 1234
.<head>
or <body>
section:
<lw-template>
HTML snippet in the <body>
of every page where you want the virtual agent to display.
product_id
. The following example uses .product .product-name @value
that extracts a product ID of 1234.
<head>
or <body>
section:
<lw-template>
HTML snippet in the <body>
of every page where you want the virtual agent to display. The example code sample uses https://www.example.com/sale/1234
and product-id
in the snippet. If your product-id
attribute name is different than what is copied in the snippet, manually change the name of your attribute.
.lw-template
properties.