move pixel to web

This commit is contained in:
zeppi 2021-07-13 23:40:49 -04:00
parent f390320030
commit e6376871d5
3 changed files with 47 additions and 12 deletions

View file

@ -13,6 +13,10 @@ import LbcSymbol from 'component/common/lbc-symbol';
import WaitUntilOnPage from 'component/common/wait-until-on-page'; import WaitUntilOnPage from 'component/common/wait-until-on-page';
import useGetLivestreams from 'effects/use-get-livestreams'; import useGetLivestreams from 'effects/use-get-livestreams';
// @if TARGET='web'
import Pixel from 'web/component/pixel';
// @endif
type Props = { type Props = {
authenticated: boolean, authenticated: boolean,
followedTags: Array<Tag>, followedTags: Array<Tag>,
@ -128,13 +132,9 @@ function HomePage(props: Props) {
{rowData.map(({ title, route, link, icon, help, options = {} }, index) => { {rowData.map(({ title, route, link, icon, help, options = {} }, index) => {
return getRowElements(title, route, link, icon, help, options, index); return getRowElements(title, route, link, icon, help, options, index);
})} })}
{/* @if TARGET='web' */}
{SIMPLE_SITE && ( <Pixel type={'retargeting'} />
<img {/* @endif */}
src="https://ctrack.trafficjunky.net/ctrack?action=list&type=add&id=0&context=Odysee&cookiename=RetargetingPixel&age=44000&maxcookiecount=10"
alt=""
/>
)}
</Page> </Page>
); );
} }

View file

@ -8,6 +8,7 @@ import Button from 'component/button';
import { Lbryio } from 'lbryinc'; import { Lbryio } from 'lbryinc';
import I18nMessage from 'component/i18nMessage'; import I18nMessage from 'component/i18nMessage';
import Card from 'component/common/card'; import Card from 'component/common/card';
import Pixel from 'web/component/pixel';
type Props = { type Props = {
history: { push: (string) => void, location: { search: string } }, history: { push: (string) => void, location: { search: string } },
@ -132,11 +133,9 @@ function SignInVerifyPage(props: Props) {
} }
/> />
</div> </div>
{/* @if TARGET='web' */}
<img <Pixel type={'kill'} />
src="https://ctrack.trafficjunky.net/ctrack?action=list&type=add&id=0&context=Odysee&cookiename=KillPixel&age=0&maxcookiecount=10" {/* @endif */}
alt=""
/>
</Page> </Page>
); );
} }

36
web/component/pixel.jsx Normal file
View file

@ -0,0 +1,36 @@
// @flow
import React from 'react';
import { SIMPLE_SITE } from 'config';
type Props = {
type: string,
};
const Pixel = (props: Props) => {
const { type } = props;
if (!SIMPLE_SITE) {
return null;
}
if (type === 'retargeting') {
return (
<>
<img
src="https://ctrack.trafficjunky.net/ctrack?action=list&type=add&id=0&context=Odysee&cookiename=RetargetingPixel&age=44000&maxcookiecount=10"
alt=""
/>
</>
);
} else if (type === 'kill') {
return (
<>
<img
src="https://ctrack.trafficjunky.net/ctrack?action=list&type=add&id=0&context=Odysee&cookiename=KillPixel&age=0&maxcookiecount=10"
alt=""
/>
</>
);
} else {
return null;
}
};
export default Pixel;