Created
April 7, 2022 08:38
-
-
Save emilhein/bf9b34b216000f8e7385196c9132d532 to your computer and use it in GitHub Desktop.
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
function insertPixel(params) { | |
const pixelUrl = `https://YOUR_DISTRIBUTION.cloudfront.net/1x1.png`; | |
const pixel = document.createElement("img"); | |
pixel.setAttribute( | |
"src", | |
`${pixelUrl}${params}&someunique=${getRandomNumber()}` | |
); | |
pixel.setAttribute("height", "1"); | |
pixel.setAttribute("width", "1"); | |
document.body.appendChild(pixel); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment