Skip to content

Commit

Permalink
Add new pixel (#1127)
Browse files Browse the repository at this point in the history
* Add new pixel

* remove unused pixels

---------

Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
  • Loading branch information
picklelo and Tom Gotsman authored Dec 4, 2024
1 parent bdf90d7 commit 0aeee89
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 50 deletions.
2 changes: 0 additions & 2 deletions pcweb/telemetry/pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ def get_pixel_website_trackers() -> list[rx.Component]:
return list(
itertools.chain(
pixels_google.get_pixel_website_trackers(),
# pixels_common_room.get_pixel_website_trackers(),
pixels_koala.get_pixel_website_trackers(),
pixels_posthog.get_pixel_website_trackers(),
pixels_clearbit.get_pixel_website_trackers(),
pixels_rb2b.get_pixel_rb2b_website_trackers(),
# pixels_instantly.get_pixel_website_trackers(),
),
)
29 changes: 0 additions & 29 deletions pcweb/telemetry/pixels_common_room.py

This file was deleted.

16 changes: 0 additions & 16 deletions pcweb/telemetry/pixels_instantly.py

This file was deleted.

17 changes: 14 additions & 3 deletions pcweb/telemetry/pixels_rb2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
PIXEL_SCRIPT_RB2B: str = """
!function () {var reb2b = window.reb2b = window.reb2b || [];if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);args.unshift(method);reb2b.push(args);return reb2b;};};for (var i = 0; i < reb2b.methods.length; i++) {var key = reb2b.methods[i];reb2b[key] = reb2b.factory(key);}reb2b.load = function (key) {var script = document.createElement("script");script.type = "text/javascript";script.async = true;script.src = "https://s3-us-west-2.amazonaws.com/b2bjsstore/b/" + key + "/reb2b.js.gz";var first = document.getElementsByTagName("script")[0];first.parentNode.insertBefore(script, first);};reb2b.SNIPPET_VERSION = "1.0.1";reb2b.load("0OV0VHLWZX6Z");}();"""

PIXEL2 = """
!function () {var reb2b = window.reb2b = window.reb2b || [];
if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];
reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);
args.unshift(method);reb2b.push(args);return reb2b;};};
for (var i = 0; i < reb2b.methods.length; i++) {var key = reb2b.methods[i];reb2b[key] = reb2b.factory(key);}
reb2b.load = function (key) {var script = document.createElement("script");script.type = "text/javascript";script.async = true;
script.src = "https://s3-us-west-2.amazonaws.com/b2bjsstore/b/" + key + "/4N210HEPR96Z.js.gz";
var first = document.getElementsByTagName("script")[0];
first.parentNode.insertBefore(script, first);};
reb2b.SNIPPET_VERSION = "1.0.1";reb2b.load("4N210HEPR96Z");}();"""

def get_pixel_rb2b_website_trackers()-> Generator[rx.Component, None, None]:
yield rx.script(
PIXEL_SCRIPT_RB2B,
)
yield rx.script(PIXEL_SCRIPT_RB2B)
yield rx.script(PIXEL2)

0 comments on commit 0aeee89

Please sign in to comment.