Skip to main content

GA4 | How to Add UTM Parameters to Special URLs

Depending on your integration needs, the Feversocial dashboard's promo URL section offers several types of production URLs — for example, a LIFF URL for LINE promos, an auto-login URL for apps, and a special LIFF URL for binding LINE members.

This article shows you how to add UTM parameters to each of these URL formats, so your UTM tracking is captured correctly during your promotion.


Step 1: Get your promo URL from the dashboard and prepare your parameters

Promo editor > Promo Page > get the URL you want to work with

UTM parameter string (if you have multiple, separate them with &):

Example: utm_source=app&utm_medium=banner


Step 2: Use an AI tool to process your URL

Tools to use: Gemini or ChatGPT both work with the prompt below.

[Prompt below]


Please help me embed parameters into the following URL. Follow the "processing logic" below to automatically detect the URL type and take the corresponding action.

### (1) My promo URL:

Paste your original URL here

### (2) The UTM parameters I want to add:

Paste the full parameter string here (e.g. utm_source=app&utm_medium=banner)

---

### Processing logic (AI must follow strictly):

Step 1: Detect the URL type

Check whether the "promo URL" contains the string redirect_uri=.

- If it does, run [Mode A].

- If it doesn't, run [Mode B].

[Mode A: Auto-login / encoded type] (when the URL has redirect_uri)

1. Extract: Pull out the string after redirect_uri= and before &sponsor_uuid=.

2. Decode: URL-decode the extracted string.

3. Combine: Append the "UTM parameters" to the end of the decoded URL.

- (If the decoded URL already has a ?, connect the parameters with &; if not, use ?.)

4. Encode: URL-encode the entire string after adding the parameters.

5. Replace: Put the encoded result back into the original URL's redirect_uri= position, replacing the old content, and output the final URL.

[Mode B: Standard LIFF type] (when the URL has no redirect_uri)

1. Locate: Find the position of the first question mark ? in the URL.

2. Insert: Insert the "UTM parameters" right after the ?.

3. Connect: Add an & after the inserted parameters so they connect to the existing parameters that follow (like liff_id).

4. Output: Output the final URL.

---

Just give me the completed URL — no need to explain the steps.


Once it's done, you'll have a complete URL with the parameters added, ready to use right away!

Reminder: Everyone makes mistakes sometimes — after generating any URL, remember to test it to make sure it works correctly!

Did this answer your question?