--- title: "Universal Segment" slug: "universal-segment" updated: 2026-08-27T17:23:04Z published: 2026-08-27T17:23:04Z canonical: "help.dsp.samsungads.com/universal-segment" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.dsp.samsungads.com/llms.txt > Use this file to discover all available pages before exploring further. # Universal Segment The *Universal* Segment is a JavaScript tag. This tag is able to detect the URL of the page it is implemented on, and the URL detection capability can be leveraged to create different segments based on the URL. Additional custom variables can be leveraged to extract additional data from the website to build more granular segments. Each segment will share the same JavaScript tag for the entire buyer account. ## Universal segment settings When using *Universal* segment, you can configure custom variables that can be then used in your segment to determine if the user belongs to that segment based on information provided by the website. Those variables need to be set up beforehand, so you can select them in the conditions section of your *Universal* segment. 1. In the left menu, click **Data** and select **Segments**. 2. In the upper right-hand corner, click **Universal Segment Settings**. (3).png?sv=2026-02-06&spr=https&st=2026-11-10T17%3A02%3A31Z&se=2026-11-10T18%3A02%3A31Z&sr=c&sp=r&sig=3Mi5orE2KHiNdsQkOsaD1BkctvBYKo7%2BUETyHyix6ug%3D) There are 2 types of custom variables:  - **String**: Using this type, Samsung DSP will expect the value passed to that variable to contain any sequence of characters. Ex: Hello World. Targeting rules for strings will contain operators such as "contains", "starts with", or "ends with". - **Integer**: Using this type, Samsung DSP will expect the value passed to that variable to be a whole number, without fraction/decimals. Ex: 10. Targeting rules for integers will contain operators such as "greater than" or "less than". Once set up, you can now create a universal segment using the custom variables you defined. ## Create a Universal Segment - In the left menu, click **Data** and select **Segments**. - In the upper right-hand corner, click **+New Segment** and select **Universal Segment**. - Fill in out the following form and click **Create** to finish.  **General Settings** - **Name**: Enter a name for your segment. - **Expiry**: Enter an expiry time for the retargeting. Ex: 15 days, means that if we don’t see that user again after 15 days, that user will no longer be part of that segment. - **Description**: Enter a description of the segment. - **Universal Tag conditions**: This is where you set up the conditions for the segment to be triggered. By default, only the URL of the page where the segment is implemented would be available. You can choose different matching conditions on the URL, such as contains, exact match, etc. Once you’ve set up custom variables, those variables will also appear as conditions, and the matching conditions will depend on the type of custom variables you have set up.   **Piggyback HTML** This is if you want to include HTML/JavaScript code that will also be triggered at the same time as the segment. This would be useful if you want to call other pixels at the same time.  In the piggyback HTML field, you can also include the following macros: | Macro | Type | Description | | --- | --- | --- | | __AG_URL__ | string | The URL passed to the universal tag, either manually (in the __AG variable) or automatically. | | __AG_REV__ | number | The revenue number passed to the universal tag (in the __AG variable). | | __AGDATA[name]__ | string or number | Any variable set in the __AGDATA JavaScript variable. Replace name with the name of the variable. | ### Copy/Download a Universal tag - On the segment row, click the three dots located in the *Actions* column:  - Select **Copy Tag** to copy the tag in your clipboard. - Select **Download Tag** to download a .txt file containing the pixel/tag. All *Universal* segments will use the same code/tag so you don’t need to copy/download it for each segment. ## Implement a Universal tag The Samsung DSP universal segment tag can be placed directly on a webpage or in your preferred tag manager, such as Adobe Tag Manager or Google Tag Manager. Below is an example of a Universal Segment tag: ``` ``` ### Tag Managers **Click here to expand** | Tag Manager | Type | Implementation Notes | | --- | --- | --- | | Google Tag Manager | Custom HTML | Paste the entire code provided by Samsung DSP. Ex: ``` ``` **NOTE**: This does not apply to the **Custom image** type. | | Google Floodlight | Dynamic tag | Paste the entire code provided by Samsung DSP. Ex: ``` ``` | ### Complete HTML Page Example **Click here to expand** When placing the universal segment tag directly into your web page HTML, it must be between **
** and **** HTMLtags. It is recommended to place it near the bottom before the closing ** ...content...** HTML tag. The __AGDATA JSON object is where you can provide custom information that can then be use to generate the segments in Samsung DSP. Make sure that the custom variables are setup in Samsung DSP first so that the data can be available to build the segments. Here's a really simple example of a universal segment tag on a blank page: ```