NeoTag is the Datahash tag for your website. It identifies visitors, records what they do, and sends those events onward to the advertising platforms you have connected. One tag serves all of them.
That is the reason to choose it. Where the alternative is a separate base code for every platform you advertise on, NeoTag is a single script you install once and point at as many destinations as you like. It also handles both browser-side and server-side reporting, so a blocked browser request does not lose the event.
For the choice between this and the per-platform option, see Website tag setup and dhPixel.
Before you start
Section titled “Before you start”- A website source configured in Studio. The tag code is on the Setup tab of that source.
- Your subdomain set up and resolving, because the script loads from it. See Subdomain setup.
- Access to your site’s HTML, or to a tag manager such as Google Tag Manager.
Installing it
Section titled “Installing it”Copy the base code from the Setup tab of your website source in Studio. It already contains your subdomain and your key, so use the copy from Studio rather than retyping one from documentation.
Then add it in one of two places.
- Directly in the page, inside the
headtag. The script loads asynchronously, so it does not hold up the page. - Or through a tag manager. In Google Tag Manager, create a new tag, choose Custom HTML, paste the base code, name it something recognizable such as NeoTag Base Script, and save. Then submit and publish the container, because a saved container that has not been published is not live.
What the base code does
Section titled “What the base code does”- Queues any events that fire before the script has finished loading, then replays them once it is ready. Nothing is lost to timing.
- Loads the NeoTag script from your subdomain.
- Records the page view immediately, including the full URL and any UTM parameters.
The methods you will use
Section titled “The methods you will use”| Method | What it does |
|---|---|
load() | Loads the NeoTag script from your subdomain. The snippet calls this for you. |
page() | Records a page view. The snippet calls this on load, and it captures the full URL including UTM parameters, along with the path, referrer, search string and page title. |
track() | Records an event and the properties you send with it. This is the one you will use for everything beyond page views. |
Sending events
Section titled “Sending events”Each event is a track call with a name and its properties. In a tag manager, create a tag per event, put the call in it, and give it a trigger such as a page view or a button click.
A purchase looks like this, with the values coming from your own variables rather than being typed in. The double-brace names are Google Tag Manager variables.
neotag.track('purchase', { transaction_id: {{Transaction ID}}, currency: {{Currency}}, value: {{Value}}, products: {{CJS NeoTag Products}},});Hardcoding any of those values sends the same conversion on every fire, which the destination cannot deduplicate and cannot value.
Turning your data layer into products
Section titled “Turning your data layer into products”Commerce events carry a products array, and the shape NeoTag expects is not the shape most data layers already use. Rather than rewriting your data layer, convert it once in a custom JavaScript variable and reuse that variable on every event.
In Google Tag Manager, create a variable of type Custom JavaScript, write a function that loops over your existing items array and returns objects in the NeoTag shape, name it something like CJS NeoTag Products, and save it. Then use that variable as the products value on your event tags.
This is worth doing even for a single event, because it keeps the mapping in one place and stops the same conversion being described differently on two tags.
| Your data layer property | NeoTag property | Notes |
|---|---|---|
item_name | name | Product name. Required. |
item_id | sku | Product SKU or ID. Required. |
price | price | Product price. |
quantity | quantity | Defaults to 1 where absent. |
item_category | category | Primary category. Further category levels map to category2 through category5. |
item_brand | brand | Product brand. |
item_variant | variant | Size, color and similar. |
If your data layer sits at a different path, or holds fields the mapping above does not cover, adjust the function. A price held as a string needs converting to a number, and any extra property can be carried through under a name of your choosing.
Event reference
Section titled “Event reference”These are the standard events. The properties shown are the ones in each example, and you should set their values from your own data layer rather than sending them as written.
| Event | When to send it | Properties in the example |
|---|---|---|
view_promotion | A promotion was viewed in a list. | creative_name, promotion_id, products |
select_promotion | A promotion was selected from a list. | promotion_id, promotion_name, products |
view_item_list | A list of items in a category was shown. | currency, products |
select_item | An item was selected from a list. | currency, products |
view_item | A product detail page was shown. | currency, value, products |
add_to_cart | An item was added to the cart. | currency, value, products |
view_cart | The cart was viewed. | currency, products |
remove_from_cart | An item was removed from the cart. | currency, products |
begin_checkout | Checkout started. | coupon_code, currency, products |
add_shipping_info | Shipping information was added. | coupon_code, shipping_tier |
add_payment_info | Payment information was added. | payment_type |
add_to_wishlist | An item was added to a wishlist. | currency, products |
search | A search was performed. | search_term |
complete_registration | Someone signed up. | method |
login | Someone logged in. | success |
share | Content was shared. | content_type, item_id, method |
rate | Content or a product was rated. | content_type, item_id, rating |
purchase | A purchase completed. | transaction_id, currency, value, products |
refund | A refund was issued. | transaction_id, value, products |
click_button | A button you care about was clicked. | button_name |
generate_lead | A lead was generated, for example a form submission. | form_id |
If you already have platform pixels installed
Section titled “If you already have platform pixels installed”Remove or pause them for any pixel NeoTag is now handling. Running NeoTag and a platform’s own script against the same pixel produces conflicting and duplicated tracking. NeoTag covers both the browser and the server side, so it replaces the platform script rather than sitting alongside it.
Checking it works
Section titled “Checking it works”-
Open your tag manager’s preview mode.
-
Confirm the base code fires on page load.
-
Confirm each event tag fires on its trigger, and not on any other.
-
Submit and publish the container.
Datahash verifies the implementation from our side once data starts arriving, and you get an email or an in-app notification when it does.
Supported browsers
Section titled “Supported browsers”Chrome 54 and later, Firefox 47 and later, Safari 7 and later, Edge 80 and later, Opera 43 and later, and Internet Explorer 10 and later.

