add retargeting pixel #6438

Merged
DispatchCommit merged 4 commits from retargetting-pix into master 2021-07-14 05:49:18 +02:00
3 changed files with 50 additions and 2 deletions

View file

@ -13,6 +13,10 @@ import LbcSymbol from 'component/common/lbc-symbol';
import WaitUntilOnPage from 'component/common/wait-until-on-page';
import useGetLivestreams from 'effects/use-get-livestreams';
// @if TARGET='web'
import Pixel from 'web/component/pixel';
// @endif
type Props = {
authenticated: boolean,
followedTags: Array<Tag>,
@ -128,6 +132,9 @@ function HomePage(props: Props) {
{rowData.map(({ title, route, link, icon, help, options = {} }, index) => {
return getRowElements(title, route, link, icon, help, options, index);
})}
{/* @if TARGET='web' */}
<Pixel type={'retargeting'} />
{/* @endif */}
</Page>
);
}

View file

@ -8,9 +8,11 @@ import Button from 'component/button';
import { Lbryio } from 'lbryinc';
import I18nMessage from 'component/i18nMessage';
import Card from 'component/common/card';
// @if TARGET='web'
import Pixel from 'web/component/pixel';
// @endif
type Props = {
history: { push: string => void, location: { search: string } },
history: { push: (string) => void, location: { search: string } },
doToast: ({}) => void,
};
@ -132,6 +134,9 @@ function SignInVerifyPage(props: Props) {
}
/>
</div>
{/* @if TARGET='web' */}
<Pixel type={'kill'} />
{/* @endif */}
</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;