Map Your Site Categories Using Code
Use Sections to categorise your web site and display an engagement for each category.
You’ve just finished creating an engagement for one of the categories on your website – for example, cameras. You want the engagement to display on all the pages in the camera category. One option is to use a location-based URL. However this means that you will need to manually add each camera-related page URL into Live Assist.
To save you time, it is also possible to add a tag, or Section, to your page code. This Section associates a category name (camera, in our example) to the page; any new or existing page that you tag with the camera Section will display the engagement automatically. A page can be represented by one or more tags – for example, you can tag camera or camera and DSLR - giving you greater flexibility in location targeting, which in turn makes your campaign more effective.
In the LiveEngage UI, adding the tag using quotes (e.g, “camera DSLR”) will ensure that the engagement is displayed on all pages with this exact tag (camera DSLR). Adding the tag without quotes (e.g. camera) will mean the engagement is displayed on all pages with a tag containing that text (e.g. camera, camera DSLR, waterproof camera etc).
Since website locations in Live Assist are based (by default), on URLs, Sections will be valuable when:
1. You make frequent changes to your website and it’s hard to keep track of the pages in each category.
2. Your URLs are not readable. For example, the URL “www.urlexample.uk/articles/aaa/bbb.html” doesn’t indicate the location of the visitor on your website.
3. Your website URLs are not structured. For example, the URL “www.urlexample.com/XX3000” doesn’t indicate the XX3000 product category. By adding a Section to the page, you can identify its category.
- Sections only work on page load; not on Single Page Application (SPA)
- Adding Sections to your website requires adding code to the relevant web pages and should be done by a web developer
Before creating an engagement for each Section on your website, you’ll need a list of all the Sections that exist on your site. Contact your web developer to get the list of Sections.
How to created a Section for your engagement
1. Go to the Campaigns page, and click Data Sources:
2. Under Engagement Attributes click Visitor Journey and use the example code under Sections.
3. Paste the code on the pages where you want to display the engagement. Change the code sample Section names according to your category names:
4. In the Campaign under the engagement, click Location:
5. Click Add new.
6. Enter a location name (a category, e.g., loans).
7. Select Section and type the Section names where you want the engagement to display. Remember you can tag as many Sections as you want to one location and if you want exact matches, you will need to use quotes.
8. Click Save.
Enhance the process of assigning locations to your engagements by tagging your pages with Sections.