Skip to content

Conversation

@0x3639
Copy link

@0x3639 0x3639 commented Jun 3, 2024

Remove trackers related to zenon.org tracking and affiliate marketing program. These tracking and conversion activities have nothing to do with Zenon Network. Can you please create a separate branch and URL for zenon.org affiliate marketing activities so they can track their users separately?

Remove trackers related to zenon.org tracking and affiliate marketing program
@0x3639
Copy link
Author

0x3639 commented Jun 3, 2024

Another option would be to default the value to "" and listen for it in the URL. Here is some code for the GTM_ID and PIXEL_ID. I have not tested either of these but can if you want me to.

<script>
    function getParameterByName(name) {
        name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
            results = regex.exec(location.search);
        return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }

    var gtmId = getParameterByName('GTM_ID');

    if (gtmId) {
        (function(w,d,s,l,i){
            w[l]=w[l]||[];w[l].push({'gtm.start':
            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
        })(window,document,'script','dataLayer', gtmId);
    } else {
        console.log("No GTM ID provided in the URL.");
    }
</script>

Potential Twitter Script

<script>
        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
            var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                results = regex.exec(location.search);
            return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
        }

        var pixelId = getParameterByName('PIXEL_ID');
        var eventId = getParameterByName('EVENT_ID');

        // Insert Twitter Script
        if (pixelId && eventId) {
            !function(e,t,n,s,c,u){
                e.twq||(s=e.twq=function(){
                    s.exe?s.exe.apply(s,arguments):s.queue.push(arguments)
                },s.version="1.1",s.queue=[],
                (c=t.createElement(n)).async=!0,c.src="https://static.ads-twitter.com/uwt.js",
                (u=t.getElementsByTagName(n)[0]).parentNode.insertBefore(c,u))
            }(window,document,"script");
            
            // Initialize Twitter pixel
            twq('init', pixelId);
            twq('track', eventId);
        } else {
            console.log("No Twitter Pixel ID or Event ID provided in the URL.");
        }
    </script>
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant