-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1792 from iFixit/vulcan-pixel-ping-for-correspond…
…ing-wiki-page
- Loading branch information
Showing
5 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { PIXEL_PING_URL } from '@config/env'; | ||
|
||
export const PixelPing = ({ | ||
type, | ||
id, | ||
site = 'ifixit', | ||
lang = 'en', | ||
}: { | ||
type: string; | ||
id: number; | ||
site?: string; | ||
lang?: string; | ||
}) => { | ||
if (!PIXEL_PING_URL) { | ||
return null; | ||
} | ||
|
||
const intId = Math.trunc(id); | ||
const key = `${site}/${type}/${intId}/${lang}`; | ||
const url = `${PIXEL_PING_URL}?key=${encodeURIComponent(key)}`; | ||
return ( | ||
// eslint-disable-next-line @next/next/no-img-element | ||
<img src={url} width="1" height="1" alt="" style={{ display: 'none' }} /> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
import { PIXEL_PING_URL } from '@config/env'; | ||
import { PixelPing } from '@components/analytics/PixelPing'; | ||
|
||
export const PixelPing = ({ productcode }: { productcode: string }) => { | ||
if (!PIXEL_PING_URL) { | ||
return null; | ||
} | ||
const key = `ifixit/product/${productcode}/en`; | ||
const url = `${PIXEL_PING_URL}?key=${encodeURIComponent(key)}`; | ||
return ( | ||
// eslint-disable-next-line @next/next/no-img-element | ||
<img src={url} width="1" height="1" alt="" style={{ display: 'none' }} /> | ||
); | ||
export const ProductPixelPing = ({ productcode }: { productcode: number }) => { | ||
return <PixelPing id={productcode} type="product" />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
02e5b80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-commerce – ./frontend
react-commerce-ifixit.vercel.app
react-commerce-git-main-ifixit.vercel.app
react-commerce.vercel.app
02e5b80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-commerce-prod – ./frontend
react-commerce-prod-git-main-ifixit.vercel.app
react-commerce-prod.vercel.app
react-commerce-prod-ifixit.vercel.app