Skip to content

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.

  • 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.

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 head tag. 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.
  • 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.
MethodWhat 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.

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.

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 propertyNeoTag propertyNotes
item_namenameProduct name. Required.
item_idskuProduct SKU or ID. Required.
pricepriceProduct price.
quantityquantityDefaults to 1 where absent.
item_categorycategoryPrimary category. Further category levels map to category2 through category5.
item_brandbrandProduct brand.
item_variantvariantSize, 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.

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.

EventWhen to send itProperties in the example
view_promotionA promotion was viewed in a list.creative_name, promotion_id, products
select_promotionA promotion was selected from a list.promotion_id, promotion_name, products
view_item_listA list of items in a category was shown.currency, products
select_itemAn item was selected from a list.currency, products
view_itemA product detail page was shown.currency, value, products
add_to_cartAn item was added to the cart.currency, value, products
view_cartThe cart was viewed.currency, products
remove_from_cartAn item was removed from the cart.currency, products
begin_checkoutCheckout started.coupon_code, currency, products
add_shipping_infoShipping information was added.coupon_code, shipping_tier
add_payment_infoPayment information was added.payment_type
add_to_wishlistAn item was added to a wishlist.currency, products
searchA search was performed.search_term
complete_registrationSomeone signed up.method
loginSomeone logged in.success
shareContent was shared.content_type, item_id, method
rateContent or a product was rated.content_type, item_id, rating
purchaseA purchase completed.transaction_id, currency, value, products
refundA refund was issued.transaction_id, value, products
click_buttonA button you care about was clicked.button_name
generate_leadA 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.

  1. Open your tag manager’s preview mode.

  2. Confirm the base code fires on page load.

  3. Confirm each event tag fires on its trigger, and not on any other.

  4. 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.

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.