MCPcopy Create free account
hub / github.com/dailydotdev/apps / TiktokTracking

Function TiktokTracking

packages/webapp/components/Pixels.tsx:363–407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361};
362
363const TiktokTracking = (): ReactElement => {
364 return (
365 <Script
366 id="tiktok-pixel"
367 strategy="afterInteractive"
368 data-tiktok-id={TIKTOK_TRACKING_ID}
369 >
370 {`(function() {
371 const TIKTOK_PIXEL_ID = document.currentScript.getAttribute('data-tiktok-id');
372
373 function initializeTiktokPixel(w, d, t) {
374 w.TiktokAnalyticsObject = t;
375 var ttq = w[t] = w[t] || [];
376 ttq.methods = ['page', 'track', 'identify', 'instances', 'debug', 'on', 'off', 'once', 'ready', 'alias', 'group', 'enableCookie', 'disableCookie'], ttq.setAndDefer = function(t, e) {
377 t[e] = function() {
378 t.push([e].concat(Array.prototype.slice.call(arguments, 0)));
379 };
380 };
381 for (var i = 0; i < ttq.methods.length; i++) ttq.setAndDefer(ttq, ttq.methods[i]);
382 ttq.instance = function(t) {
383 for (var e = ttq._i[t] || [], n = 0; n < ttq.methods.length; n++) ttq.setAndDefer(e, ttq.methods[n]);
384 return e;
385 }, ttq.load = function(e, n) {
386 var i = 'https://analytics.tiktok.com/i18n/pixel/events.js';
387 ttq._i = ttq._i || {}, ttq._i[e] = [], ttq._i[e]._u = i, ttq._t = ttq._t || {}, ttq._t[e] = +new Date, ttq._o = ttq._o || {}, ttq._o[e] = n || {};
388 var o = document.createElement('script');
389 o.type = 'text/javascript', o.async = !0, o.src = i + '?sdkid=' + e + '&lib=' + t;
390 var a = document.getElementsByTagName('script')[0];
391 a.parentNode.insertBefore(o, a);
392 };
393
394 ttq.load(TIKTOK_PIXEL_ID);
395 ttq.page();
396 }
397
398 initializeTiktokPixel(
399 window,
400 document,
401 'ttq',
402 );
403})();
404`}
405 </Script>
406 );
407};
408
409const QuoraTracking = (): ReactElement => {
410 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected