Skip to main content

How to conditionally trigger Mida script from Google Tag Manager

Updated over a week ago

How to conditionally trigger Mida script from Google Tag Manager

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

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

  3. Step 3: Name your new tag.

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

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

  6. 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.

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

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

  9. 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]").

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

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

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

Did this answer your question?