Lexer Javascript Tag basics

Enrich your customer data

The Lexer Javascript (JS) Tag is an HTML extension that can be used to enrich your existing customer data with our "out of the box" attributes. In this article, we’ll discuss how the Javascript Tag works, its benefits, and the ‘out of the box’ attributes, before wrapping up and talking through some next steps.

How does the Lexer Javascript Tag work?

The Javascript Tag is a straight forward set of instructions to implement and can be embedded in the code of your website or inside of a tag manager, for example, Google Tag Manager.

The Javascript Tag works by capturing customer data, such as the number of seconds it took the customer to checkout in their last session, present on your website’s existing dataLayers. This data is identified when we scope your website. If there is no current dataLayer identified on site when we are scoping, then we make dataLayer recommendations according to Google Enhanced Ecommerce standards to gather the data.

This data is then sent to Lexer through a Payload that can map to a customer profile through an identifiable action (i.e. newsletter subscription, account login, account registration, transaction, etc.) enriching your existing customer data.

📘

Note

For Lexer Javascript Tag data we import the last 90-days worth of events into the Hub.

Out of the box attributes

When the Javascript Tag is embedded into your website it collects your customers’ activities in an action or manner specified by you from one of the 17 ‘out of the box’ attributes listed below. Each of these is fully customizable to your use case and requirements. These attributes capture first party data from the customers’ interaction on your website once they are linked.

The Lexer Javascript Tag is not designed to support web analytics and is strictly focused on recording actions that can be linked to an identifiable customer or prospect.

Attribute name

Description

Example value

Categories viewed

A list of all the product categories viewed by a customer while on site.

T-shirts

Date of last visit

The date of the customers last visit to your website.

"2021-05-31T00:00:00.140Z"

Dates visited

A list of all the dates the customer visited your site.

"2021-05-31T03:42:14.838Z"

"2021-05-31T03:44:33.829Z"

Device used

The type of devices the customer used to browse your website.

Desktop

Did complete conversion

A flag to say that the customer did checkout.

True

Did start conversion

A flag to say that the customer started the checkout journey.

True

Pages viewed to convert

The number of pages the customer viewed to checkout in their last session.

5

Products added to cart

A list of the products added to the customers cart while on site.

Data Punk t-shirt

Products removed from cart

A list of the products removed from the customers cart while on site.

Data Maiden t-shirt

Products viewed

A list of all the products viewed by the customer while on site.

Data Rockstar t-shirt

Submitted survey

Profiles that have submitted a response to any of the surveys you have created within Lexer.

True

Referrer URL

The site responsible for the visit - i.e. the customer clicked on a Facebook post.

https://www.google.com

Time spent to convert

The number of seconds it took the customer to checkout in their last session.

200 seconds

UTM campaign

The name of the promotion or campaign that brought a customer to your site.
Helpful for understanding what campaigns customers are engaging with.

EMAIL_CAMPAIGN_TSHIRTS

UTM content

The specific content that brought the customer to your site.
Helpful for understanding the type of content a customer is willing to click on.

LogoLink

UTM medium

The medium that brought the customer to your site, such as social or email.
Helpful for understanding how a customer saw your link.

Email

UTM source

The external site that brought the customer to your site, such as Facebook or Amazon.
Helpful for understanding where a customer saw your link.

Email

UTM term

The search terms that brought the customer to your site.
Helpful for understanding ROI on paid keywords or informing keywords to put spend behind.

Shoes

Auto-tracking

The Lexer Javascript Tag automatically tracks several events upon deployment. These include:

Device used: Did the customer browse on a Mobile, Tablet, or Desktop device?
Time spent to convert: How long did the customer spend on the site?
Referrer URL: The domain of the site the customer came from, only supported on some browsers.
UTM codes: How did the customer land on my site?

Conversion

At the point of a customer’s conversion, you are able to send all captured data to Lexer by employing the 'lxt('converted')' command. This could happen when a customer makes a final action on your site, like completing the purchase of a product.

UTM codes

If you currently use UTM codes in your newsletters, the Lexer Tag will automatically collect that information once we have embedded some custom code into your newsletters/email campaigns. Contact Lexer Support ([email protected]) for assistance in setting this up.

Next steps

Now you know what the Javascript tag is and its benefits. The following Tag articles in this section expand further on the initial setup and how the dataLayer can be configured with Shopify. See our further reading suggestions below.


Did this page help you?