Merge pull request #6438 from lbryio/retargetting-pix

add retargeting pixel
This commit is contained in:
Dispatch 2021-07-13 20:49:18 -07:00 committed by GitHub
commit fba8b89b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>,
@ -137,6 +141,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;