• Resolved beachmat

    (@beachmat)


    Does this plugin support multiple IDs for the same script? I can’t see any mention of it.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Tracking an additional ID is as simple as adding another config rule to the tracking code. In CAOS this can be achieved by using a filter in a custom plugin.

    add_filter('caos_gtag_additional_config', 'daan_add_additional_ids');

    function daan_add_additional_ids() {
    echo "gtag('config', 'G-123ABC456');" // Replace with your Measurement ID
    }

    That should do it! If you need more help, you know where to find me!

    Thread Starter beachmat

    (@beachmat)

    Thanks. There’s a typo on the last line, should be

    )";
    Thread Starter beachmat

    (@beachmat)

    Or maybe

    );";
    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Ah, sorry, you’re right, here’s the correct code:

    add_filter('caos_gtag_additional_config', 'daan_add_additional_ids');

    function daan_add_additional_ids() {
    echo "gtag('config', 'G-123ABC456');"; // Replace with your Measurement ID
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.