'Why is text not working as link in Snapchat Pixel code?

I ran into an issue where this portion of the pixel code below was not recognized as a link and as a result the pixel would not fire:

https://sc-static.net/scevent.min.js [The pixel code was provide in a Google document; I copy and pasted the script below]

<script type='text/javascript'>
    (function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
    {a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
    a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
    r.src=n;var u=t.getElementsByTagName(s)[0];
    u.parentNode.insertBefore(r,u);})(window,document,
    'https://sc-static.net/scevent.min.js');
    
    snaptr('init', 'xxxxxxxxx-xxxxxxx-xxxxxxxx-xxxxxxxxx', {
    'user_email': '__INSERT_USER_EMAIL__'
    });
    
    snaptr('track', 'PAGE_VIEW');
    
    </script>

I eventually copy the pixel from the ads account and pasted it in. The pixel tag worked! ...But why?

I compared the two https://diffchecker.com/diff

Image of DiffChecker Results - Pixel copied from Google document vs copied from ads manager account.

Then I tested the code to compare the strings, result:

//ValueOne is copy/pasted from Google document
var valueOne = 'https‍://sc-static.‍net/scevent.min.‍js';

//ValueTwo is copy/pasted from ads account provided pixel code
var valueTwo = 'https://sc-static.net/scevent.min.js';

console.log('Check 1 Result: ' + valueOne === valueTwo);
console.log('Check 2 Result: ' + valueOne == valueTwo);

Output: Code Output

Warning Message in Code Output image:

Warning Message in Code Output image

How I can write code to catch and fix this? I am curious how the valueOne string can be converted to the valueTwo string/link?

If there is anything else to know, let me know.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source