Skip to Content

JavaScript File

URL: https://static.ads-twitter.com/uwt.js
HTTP Status: 200 OK
MIME Type: application/javascript
Last Modified: Wed, 18 Aug 2021 23:50:50 GMT
Download Time: Less than a second
Cookies: None
Size: 6 KB
HTTP Headers:  12 headers
Links In:  1 pages
  
OK Issues: No issues found

1!function(){"use strict";var e={30:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}

2),t.EventTracker=void 0;var i=n(213);t.EventTracker=function(){var e=this;this.pixelId="",this.eventQueue=[[]],this.setPixelId=function(t){e.pixelId=t}

3,this.queueEvent=function(t,n){var i={event:{eventName:t=t.toLowerCase().trim(),eventParams:n}

4,pixelId:e.pixelId}

5;e.eventQueue[e.eventQueue.length-1].push(i),setTimeout((function(e){return e.sendEvents()}

6),0,e)}

7,this.addFlushPoint=function(){0!==e.eventQueue[e.eventQueue.length-1].length&&e.eventQueue.push([])}

8,this.sendEventsWithParams=function(t,n){var i,r,o=e.getLegacyParams(t);o.events=JSON.stringify(t.map((function(e){return[e.eventName,e.eventParams]}

9))),null===(r=null===(i=window.twttr)||void 0===i?void 0:i.conversion)||void 0===r||r.trackPid(n,o)}

10,this.sendEvents=function(){if(0!==e.eventQueue[0].length){var t=e.eventQueue.shift()||[];0===e.eventQueue.length&&e.eventQueue.push([]);for(var n=0;n<t.length;n++)e.sendEventsWithParams([t[n].event],t[n].pixelId)}

11}

12,this.getLegacyParams=function(t){var n={}

13;if(!e.isObject(t[0])||!e.isObject(t[0].eventParams))return{}

14;var r=t[0].eventParams;return i.hasOwnPropertyCi(r,"value")&&(n.tw_sale_amount=i.getPropertyCi(r,"value")),i.hasOwnPropertyCi(r,"num_items")&&(n.tw_order_quantity=i.getPropertyCi(r,"num_items")),e.isObject(i.getPropertyCi(r,"content_ids"))&&(n.tw_product_id=i.getPropertyCi(r,"content_ids")[0]),i.hasOwnPropertyCi(r,"partner_id")&&(n.oct_p_id=i.getPropertyCi(r,"partner_id")),n}

15,this.isObject=function(e){return Object(e)===e}

16}

17}

18,566:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}

19),t.Pixel=void 0;var i=n(213),r=function(){function e(){var t=this;this.cs=!0,this.track=function(e,n,i){t.trackByImage(e,n,i)}

20,this.trackPid=function(e,n){t.trackByScript(e,n)}

21,this.buildPixel=function(e){t.buildImagePixel(e)}

22,this.buildScript=function(e){t.buildScriptPixel(e)}

23,this.buildIframe=function(e){t.buildIFramePixel(e)}

24,this.trackByScript=function(n,i){t.trackEventWithScript(e.TWITTER_BASE,n,i,!0),t.trackEventWithScript(e.TCO_BASE,n,i)}

25,this.trackByImage=function(n,i,r){t.trackEventWithImage(e.TWITTER_BASE,n,i,r),t.trackEventWithImage(e.TCO_BASE,n,i,r)}

26,this.loadPixels=function(e){"hif"in e&&e.hif.forEach(t.buildIFramePixel),"tags"in e&&e.tags.forEach(t.buildImagePixel)}

27,this.trackEventWithImage=function(e,n,r,o){var a=o?"&value="+i.enc(o):"",c=e+"&merch_id="+i.enc(n)+"&event="+i.enc(r)+a;t.buildImagePixel(c)}

28,this.trackEventWithScript=function(n,r,o,a){if(void 0===o&&(o={}

29),void 0===a&&(a=!1),r){var c="";for(var u in i.hasOwnPropertyCi(o,"tw_sale_amount")||(o.tw_sale_amount=0),i.hasOwnPropertyCi(o,"tw_order_quantity")||(o.tw_order_quantity=0),o)i.hasOwnPropertyCi(o,u)&&(c+="&"+i.enc(u)+"="+i.enc(i.getPropertyCi(o,u)));var s=t.isInIFrame(),d=n+"&txn_id="+i.enc(r)+c+"&tw_iframe_status="+i.enc(Number(s));s&&""!==document.referrer&&(d+="&tw_document_referrer="+i.enc(document.referrer));var l=t.buildImagePixel;a&&(d+=e.PIXEL_CALLBACK_ARG,l=t.buildScriptPixel),d+="&tw_document_href="+i.enc(document.location.href),t.isDocumentHidden()?(console.log("Waiting for document to be visible before firing: ",d),t.buildPixelWhenVizChange(d,l)):(console.log("Sending: ",d),l(d))}

30else console.error("[Error] No Pixel ID Found")}

31,this.isDocumentHidden=function(){return"hidden"===document.visibilityState}

32,this.buildPixelWhenVizChange=function(e,t){var n=function(){t(e),document.removeEventListener("visibilitychange",n,!1)}

33;document.addEventListener("visibilitychange",n,!1)}

34,this.buildScriptPixel=function(e){var n=document.createElement("script");n.src=e,n.setAttribute("type","text/javascript"),t.contentLoaded((function(){document.body.appendChild(n),console.log("Building an script pixel with URL: ",e)}

35))}

36,this.buildIFramePixel=function(e){var n,i;if(null===(i=null===(n=window.twttr)||void 0===n?void 0:n.conversion)||void 0===i?void 0:i.cs){window.twttr.conversion.cs=!1;var r=document.createElement("iframe");r.src=e,r.hidden=!0,t.contentLoaded((function(){document.body.appendChild(r)}

37))}

38}

39,this.buildImagePixel=function(e){(new Image).src=e,console.log("Building an image pixel with URL: ",e)}

40,this.isInIFrame=function(){return window.self!==window.top}

...

</html>