Destination Tags

Destination Tag is a type of destination that installs configured HTML/Javascript tag to the website page on receiving an event from Javascript SDK.

The required version of Jitsu Server >= 1.41.0 The required version of Javascript SDK >= 2.5.0

How it works

You need to provide HTML/Javascript code of your tag and link the destination to an API key.

When Javascript SDK sends an event to the Luden Server, and a Destination Tag is linked to the API key, Luden Server synchronously processes HTML/Javascript code template and returns the resulting code block to the Javascript SDK.

Javascript SDK parses code block:

  • All <script> tags from the code will be appended to the <head> block of you website and javascript code will be executed by browser.

  • Other html tags will be appended to the end of <body> of you website.

Configuration

Example:

destinations:
  my_tag:
    only_tokens:
      - abc.123
    type: tag
    config:
      filter: $.event_type == "pageview"
      tagid: "tag123"
      template: |-
        <script>
        console.log("Hello {{ .user.id }} from Luden!")
        </script>

Filtering

You can use JavaScript expressions to filter events so tags will be triggered for certain events only. Here are few example fo such JavaScript expressions for typical cases:

Only for "pageview" events:

$.event_type == "pageview"

For "pageview" or "conversions" events:

$.event_type == "pageview" || $.event_type == "conversions"

For authorized users only:

$.user.email

Last updated