How to conditionally trigger Mida script from Google Tag Manager

Created by LiRou C, Modified on Wed, 24 Jan at 9:33 AM by LiRou C

Step 1: Log in to your Google Tag Manager account, and select the relevant workspace for your website.

 

Step 2: In the left-side menu, select "Tags," then "New" to create a new tag.

 

Step 3: Name your new tag.

 

Step 4: Under "Tag Configuration," choose the custom HTML tag type (since most external scripts will be written in HTML).

 

Step 5: Paste your external script into the HTML container provided. Make sure to include `<script>` and `</script>` tags.

 

Step 6: Next, you need to determine the trigger for your tag (i.e., when the script will be executed). Under "Triggering," select "+New" to create a new trigger.

 

Step 7: Name your trigger and select the trigger type. In this case, it will be a "Custom Event."

 

Step 8: Under "Event name," input the name of your custom event as it appears in GTM's event tracking.

 

Step 9: By default, the event will fire on all custom events with this name. If you want it to execute only on specific conditions, you can add them under "This trigger fires on" option (e.g., you can add conditions like "Event equals [Name of the event]").

 

Step 10: Click "Save" to place these settings under the "Triggering" section of your tag.

 

Step 11: Click "Save" again to save your tag, then "Submit" and "Publish" when ready.

 

Step 12: As always, make sure to test your setup in "Preview" mode before finalizing it.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article