loadEventTracking({
origins: ["act.vot-er.org", "vot-er.org/act", "vot-er.org/vota"],
sites: [
{ href: "https://voter.turbovote.org", param: "r" },
{ href: "https://act.vot-er.org", param: "orgId" },
{ href: "https://www.vote411.org", param: "r" },
{ href: "https://www.patientvoting.com", param: "r" },
],
});
function loadEventTracking(options) {
options = options || {};
const { origins, sites, eventsURL } = options;
// Grab the ref and organization ID params from the URL
const params = new URLSearchParams(window.location.search);
const urlRef = params.get("ref");
const urlOrganizationId = params.get("organizationId");
const urlUserId = params.get("userId");
const urlSrc = params.get("src");
// Save them to LocalStorage in case they go to another page (e.g., changing language)
if (urlRef) localStorage.setItem("ref", urlRef);
if (urlOrganizationId) localStorage.setItem("organizationId", urlOrganizationId);
if (urlUserId) localStorage.setItem("userId", urlUserId);
if (urlSrc) localStorage.setItem("src", urlSrc);
// Grab them from LocalStorage in case they were set from another page
const ref = localStorage.getItem("ref");
const organizationId = localStorage.getItem("organizationId");
const userId = localStorage.getItem("userId");
const src = localStorage.getItem("src");
// Create a reusable function for sending tracking events
const track = function (data) {
return fetch(eventsURL || "https://events.vot-er.org/", {
method: "POST",
mode: "no-cors",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
};
if (origins && !origins.some((url) => window.location.href.includes(url))) return;
// Track the visit to this page
track({
type: "visit",
destination: window.location.href,
ref: ref,
});
// Track visits to other pages
sites.forEach(function (site) {
const siteHref = site.href;
const links = Array.from(document.querySelectorAll("a")).filter((link) =>
link.href.includes(siteHref)
);
links.forEach(function (link) {
// Add the organization ID to URL if applicable
if (site.param && (organizationId || userId || src)) {
const url = new URL(link);
const linkParams = new URLSearchParams(url.search);
linkParams.set(site.param, [organizationId, userId, src].join(","));
link.href = `${url.origin}${url.pathname}?${linkParams.toString()}`;
}
// Track clicks
link.addEventListener("click", function (event) {
event.preventDefault();
event.stopPropagation();
track({
type: "link",
destination: link.href,
ref: ref,
})
.catch((err) => {
console.log("Error: ", err);
})
.finally(() => {
window.location = link.href;
});
});
});
});
}
top of page
Get Involved
Joining Patient Voting can be as easy as committing to tell your patients about their right to vote and directing them to info on our page, or as involved as organizing your own Patient Voting team within your hospital. We ask that by joining, you commit to our non-partisan mission to encourage all patients to vote, regardless of their party affiliation.​
We have stickers, flyers, and business card size information brochures that you can share with your patients and your hospital. Any of these can be customized to include your hospital's name/logo, phone numbers. Just make sure to get permission from your hospital before distributing information with their name/logo!