Codes
  • 23 Jun 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Codes

  • Dark
    Light

With code snippet elements you have the option to publish javascript snippets to the frontend (client side). They will be therefore delivered from the same first party as the JENTIS JS SDK (as a single JS file bundle).

Please consider the following hints on using those elements:

  1. Code Elements are executed instantly.
    When the JENTIS basic code snippet is executed in a users browser all code elements will also be executed, too. 
  2. Code snippets are executed one by one.
    A priority of all those code elements is possible, if a sequence is required. Use the "order" field property in a code element for that purpose. The order of code snippets is from low to high numbers (Integer).
  3. No Triggers.
    All code elements are executed initially with no conditions. If conditions are required those must be implemented in the Javascript code snippet, which is a customization. There is no native feature in JENTIS for customized trigger conditions for code elements.
  4. No HTML.
    The field "Javascript Code" only allows the use of Javascript, please do not enter HTML (like "<script>...</script>" - do not use this).

Add a Code Element

To add a Javascript code snippet to your JENTIS Tag Manager container please follow this steps.

Navigate to the Components: Codes section in your JENTIS Tag Manager account. Click the "+" icon to add a new element.

In a code element you must provide the following fields:

  • Name: a descriptive short name of the code element.
  • Order: a number that defines the order of execution on initialization (Integer). Low numbers are executed first, starting with 0.
  • Containers: select the containers in your JENTIS Tag Manager account, that will include this code element when loaded.
  • Javascript Code: the actual code. Please be aware that this code will be interpreted in a closure and minified, so always mind the scope you are working with.
  • CSS Code (optional): Here you can also add custom CSS to publish to your webpage with this element.

Was this article helpful?

What's Next