Internal/External User Image retrieval (GCS)

This page utilizes the img onError html function, which allows programmatic action if image retrieval fails, for example due to access denied issues:

<img height="25" src="https://storage.cloud.google.com/zoro-internal-pixel/zoro-internal.png" onerror="console.log('||| walled image load failure in page |||');this.src='http://experiments.valuepost.click/wp-content/uploads/2020/10/zoro-external.png';" />

TEST: image file https://storage.cloud.google.com/zoro-internal-pixel/zoro-internal.png is published on GCS bucket and shared with with the whole of G=Suite Org.
If the above file is accessible to the user, the browser will retrieve it and will not raise the error, which would be accepted as a default value of “internal”. The onError function will set the user attribute in Google Analytics to “external” and set an alternate image source for the pixel. If you are authenticated to the image above, you should see a green “internal” image displayed below. However if not authenticated (e.g. in incognito view), the image source will be changed to “red -external”.

Author: admin