Lexer Javascript Tag basics

Enrich your customer data

The Lexer Javascript Tag allows you to combine digital customer behavior with purchase and email data for a true, 360 degree view of your customer.

The Lexer Tag on your website facilitates individual analysis of a customer’s on-site behaviours. All attributes that are created via the tag can be searched, analyzed, and combined with first-party data, and then segmented.

This means real humans, not cookies!

In this article, we’ll discuss how the Javascript Tag works, its benefits, and the “out of the box” attributes that it can create, before wrapping up and talking through some next steps.

Why you should use the Lexer Javascript Tag

Between privacy concerns and depreciating accuracy, the third-party cookie is on the way out, putting pressure on marketers and tech providers to shift to other alternatives.

Lexer’s zero-party data solution is the Lexer Tag, and at Lexer we’re only interested in real people we can identify, not cookies, and the Lexer Tag specializes in just that! As soon as someone identifies themselves on your channels, we track and connect their digital behaviors to their profile in the Lexer Hub.

Implementing the Lexer Javascript Tag

The Javascript Tag is straightforward to implement and can be embedded in the code of your website or inside of a tag manager, for example, Google Tag Manager. It’s a two-step process:

  1. Lexer scope and configure the Tag bespoke to you.
  2. You and your team implement the Tag on your website.

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.

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

Implementation FAQs

What is a dataLayer?

A JavaScript object that collects data on your website in a standardized way. This data is dynamic depending on the page being viewed. A dataLayer is the most robust way to pass data to the Lexer Tag.

Why do we need a Tag Management System (TMS)?

A TMS allows you to deploy and manage tags on your site without relying wholly on IT. It removes the need to hard code anything into your website. Whilst a TMS isn’t necessary for deploying the Tag, it streamlines the process from implementation to QA.

What can the Tag track?

The Lexer Tag can track any data that you surface in the dataLayer. The Tag is told what data to capture by the dataLayer path you specify for your variable.

If there is a new data point you would like to capture and it doesn’t have a corresponding Lexer attribute, get in touch with your Solutions Lead.

Out of the box attributes

When the Lexer Tag is embedded into your website it collects your customers’ activities in an action or manner specified by you from one of the 18 “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?

Lexer tip!
Remember, identity is everything!Lexer is interested in enriching profiles in the CDP. Because of this we will only send browsing behaviour to the platform once a user is identified. No identification, no tag data.

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

Urchin Tracking Module (UTM) codes are snippets of code attached to the end of a URL. They allow us to track data like traffic sources or campaign click names.

However, they don’t stop there. If you can include a UTM code in your URL, Lexer can be configured to track it.
As an example, you can append the email address of your customer to the URL when they click on an email, bumping up your identification rate.

Example: www.yoursite.com/category/product?utm_campaign=campaignName&utm_source=newsletter&utm_email=myname@email.com

Next steps

Now you know what the Lexer Javascript Tag is, its benefits, and how it can be implemented. The following Tag articles in this section expand further on the initial setup and how the dataLayer can be configured with Shopify.

Updated:
September 19, 2022
Did this page help you?
Thank you! Your feedback has been received!
Oops! Something went wrong while submitting the form, for assistance please contact support@lexer.io
Welcome to Lexer!
Fundamentals
Getting started
Our glossary
Fundamentals
Getting started
Integrations
Fundamentals
Setup
My account
Fundamentals
Setup
Manage team
Fundamentals
Setup
Group permissions
Fundamentals
Setup
Classifications
Fundamentals
Setup
Out of the box segments
Fundamentals
Setup
Browser guide
Fundamentals
Security
Corporate networks
Fundamentals
Security
Emergency contact
Fundamentals
Security
Multi-factor authentication
Fundamentals
Security
Single sign-on
Fundamentals
Security
Trust and compliance
Fundamentals
Security
Lexer's Identity Resolution
Fundamentals
Identity Resolution
Troubleshooting tech issues
Fundamentals
Troubleshooting
Error code: 503 Service Unavailable
Fundamentals
Troubleshooting
Error code: 401 Unauthorized
Fundamentals
Troubleshooting
Error code: 403 Forbidden
Fundamentals
Troubleshooting
Troubleshooting Activate
Fundamentals
Troubleshooting
Troubleshooting Respond
Fundamentals
Troubleshooting
Help! My data is missing from the Hub
Fundamentals
Troubleshooting
Understanding APIs at Lexer
Data
Data Onboarding
Providing JSON data to Lexer
Data
Data Onboarding
Providing CSV data to Lexer
Data
Data Onboarding
Upload using SFTP
Data
Data Onboarding
Upload using S3
Data
Data Onboarding
Lexer data specification
Data
Lexer Data Specification
Customer data specification
Data
Lexer Data Specification
Commerce data specification
Data
Lexer Data Specification
Marketing data specification
Data
Lexer Data Specification
Compliance data specification
Data
Lexer Data Specification
Data Formatting and Validation
Data
Getting Started with APIs
Authentication and API token creation
Data
Getting Started with APIs
Rate Limits
Data
Getting Started with APIs
Response codes and common errors
Data
Getting Started with APIs
Product imagery
Data
Getting Started with APIs
Currency conversion
Data
Getting Started with APIs
Lexer’s APIs overview
Data
Lexer’s APIs
Dataset management in the Hub
Data
Dataset management
Chatbox user API
Data
Lexer’s APIs
Activity API
Data
Lexer’s APIs
Visualize API
Hidden from nav
Profile Read API
Data
Lexer’s APIs
Lexer Javascript Tag basics
Data
Lexer Javascript Tag
Lexer Javascript Tag technical guide
Data
Lexer Javascript Tag
Lexer Javascript Tag use cases
Data
Lexer Javascript Tag
dataLayer configuration: Shopify
Data
Lexer Javascript Tag
Customer segment CSV export
Data
Data off-boarding
Export to CSV
Data
Data off-boarding
Data in Lexer's CDXP
Understand
Customer Data
Lexer's attributes
Understand
Customer Data
Attribute value types
Understand
Customer Data
Data source - CRM
Understand
Customer Data
Data source - Transactions
Understand
Customer Data
Data source - Email
Understand
Customer Data
Partner data - Experian
Understand
Customer Data
Partner data - Mastercard
Understand
Customer Data
Partner data - Roy Morgan
Understand
Customer Data
GDPR and CCPA requests
Understand
Customer Data
Upload data files
Understand
Customer Data
File upload API
Understand
Customer Data
Data provision and schemas
Understand
Customer Data
Segment overview
Understand
Segment
Creating segments
Understand
Segment
Smart Search
Understand
Segment
Export attribute results
Understand
Segment
Contact a customer
Understand
Segment
Fixing a disabled segment
Understand
Segment
Profile tab
Understand
Segment
Compare segments
Understand
Compare
Compare attributes
Understand
Compare
Activate overview
Engage
Activate
Ongoing activations
Engage
Activate
Audience splits
Engage
Activate
A/B splits
Engage
Activate
Control group splits
Engage
Activate
Inbox filtering
Engage
Respond
Ignored Senders
Engage
Respond
Forms for service
Engage
Respond
Workflow states
Engage
Respond
Bulk changes
Engage
Respond
Scheduled replies
Engage
Respond
Message templates
Engage
Respond
Customer profiles
Engage
Respond
Grouped messages
Engage
Respond
Automation rules
Engage
Respond
Redact messages
Engage
Respond
Track overview
Measure
Track
Activity overview
Measure
Activity
Team report
Measure
Activity
Cases report
Measure
Activity
Listen overview
Measure
Listen
Searching in Listen
Measure
Listen
Tier filters
Measure
Listen
Boolean search
Measure
Listen
Saved dives
Measure
Listen
Email notifications
Measure
Listen
Twitter data
Measure
Listen
Facebook data
Measure
Listen
Instagram data
Measure
Listen
Visualize overview
Measure
Visualize
Curate feed
Measure
Visualize
Report overview
Measure
Report
// Rich text for code blocks and nested lists