Smart tags

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Altocloud Administrator's Guide for version Current of Altocloud.

Deprecation: This feature will be deprecated soon. For more information, see Deprecation: Smart Tags.

Prerequisites

About Smart tags

Smart tags are small pieces of JavaScript code that allow you to refine and enhance how Altocloud tracks your website. Altocloud automatically tracks pageview events, but there are other events that you might want to track using smart tags. For example, you can use smart tags to track form-level events such as when a customer submits or abandons a form.

How they work

  1. When you build smart tags, Altocloud updates the Altocloud Tag Manager file (ATM.js) with the active smart tags.
  2. When the tracking snippet initializes and the Journey JavaScript SDK is loaded on a page, Altocloud retrieves the list of active smart tags for your organization ID.
  3. For each smart tag, Altocloud checks the execution condition defined for the smart tag. Examples of execution conditions include the presence of a specific string in the page URL, or the presence of an element with a given CSS selector on the page.
  4. For each condition that is true, Altocloud adds a new script element to the DOM with the smart tag's code.

Examples

Segment based on a smart tag


View your smart tags

1

  1. Click Admin.
  2. Under Altocloud, click Smart Tags.

Create a smart tag

1

Important
You can apply smart tags only to the pages that the tracking snippet tracks.
  1. Click Admin.
  2. Under Altocloud, click Smart Tags.
  3. Click Create Smart tag.
  4. Give the smart tag a descriptive name.
  5. Do one of the following:
  6. Activate the smart tag.

Create a page-level smart tag

1

A page-level smart tag runs every time a customer accesses a page.

  1. Under Type, select page.
  2. In the URL contains box, type the URL for the page where you want the tag to run.
  3. In the Code box, paste the code that you want to run.
Tip
To apply the smart tag to all pages in your site, type a /.

Example

To create a smart tag that uses the forms:track method to track when a customer abandons their shopping cart, in the Code box, type ac('forms:track').

Create an element-level smart tag

1

An element-level smart tag runs when a customer accesses a page that contains a specific HTML element. Specifically, the code of an element-level smart tag executes only when the smart tag is retrieved (when the Journey JavaScript SDK is loaded) provided that the element with which the smart tag is associated exists in the DOM.

Important
If you have a single page application that dynamically adds elements, be sure to add any elements that are associated with smart tags to the DOM when the page is first loaded.
  1. Under Type, select page.
  2. In the Selector box, type the CSS selector for the HTML element. For a list of valid CSS selectors, click here.
    • To track an element, in the Selector box type form#formID. Replace with the actual ID of your form.
    • To track an element that belongs to a specific class, in the Selector box, type a . first. For example: .my-class
  3. In the Code box, paste the code that you want to run.

Define the code

Use the Code box to define the JavaScript code for your smart tag. We recommend that you develop and validate your code locally in your preferred code editor before you enter it in the Code box. For information about the available JavaScript methods you can use to build smart tags, see Journey JavaScript SDK.

Important
  • Test your smart tag before you activate it.
  • The Create smart tag page provides NO error checking.
  • Your smart tag code will be executed for every customer who visits a page where the smart code runs. Consider the volume of site traffic and your network bandwidth when you define a smart tag.

Activate or inactivate a smart tag

1

When you create a smart tag, it is deactivated by default. It will not run until you activate it.

When you activate a smart tag, the Altocloud Tag Manager (ATM.js file) delivers it to your tracked web pages.

To determine whether the smart tag runs, set the Active switch to On or Off, based on your needs.

Important
The JavaScript code that you define for a smart tag will be executed every time a customer visits a page that matches the execution condition you defined for the tag (either the specific page URL or the presence of an HTML element.) Remember to test your smart tag before you activate it.
Tip
To permanently remove the smart tag, delete it instead.

Delete a smart tag

1

When you delete a smart tag, it is immediately removed from your account.

  1. Click Admin.
  2. Under Altocloud, click Smart Tags.
  3. Click the Delete button for the smart tag.
Tip
Deletion is permanent. To temporarily suspend the smart tag, inactivate it instead.