How-to
How to embed Google Wallet or Apple wallet button on Wix
On Wix, add a button or text link that opens the pass URL. Use Embed HTML only when you want the badge snippet. This page is that on-page setup. It does not link a Wix App Market listing. Site-wide button setup is in the embed guide.
The screenshots show the Wix editor: Add, Embed Code, then Embed HTML. A link button is the same job in Wix Studio. This article does not document a separate Studio menu path.
The snippet swaps the badge from the browser. Safari is set to the Apple Wallet badge. Chrome is set to the Google Wallet badge.


Use a link button
- Create the pass and copy its link from the copy icon.
- On the Wix page, add a button or text link and set the link to that pass URL.
- Publish the page.

Why Embed HTML is the second choice
Wix places Embed HTML in its own frame. The snippet below calls window.open from that frame. If the click stays inside the frame, use the link button above instead of the snippet. That note is a setup caution, not a recorded desktop or mobile test.
1. Edit the page
Open the page where the button should appear and click Edit.
2. Add an Embed HTML block
Click Add, choose Embed Code, and add Embed HTML.

3. Choose Code

4. Paste the snippet and set the pass link
Paste the snippet into the field that says to add your code. Replace buttonUrl with the pass link. The address in the sample is a placeholder, not a live pass.
<script>
window.onload = function() {
// Paste the pass link here in the button url string
const buttonUrl="https://app.addtowallet.co/card/........";
var button = document.getElementById("addToWalletButton");
var userAgent = window.navigator.userAgent;
var img = document.getElementById("walletImage");
if (userAgent.indexOf("Chrome") != -1 && userAgent.indexOf("Safari") != -1 && userAgent.indexOf("Edg") == -1) {
img.src = "https://s3.amazonaws.com/i.addtowallet.co/assets/Add_to_Google_Wallet_badge.svg.png";
} else if (userAgent.indexOf("Safari") != -1 && userAgent.indexOf("Chrome") == -1) {
img.src = "https://s3.amazonaws.com/i.addtowallet.co/assets/add_to_apple_wallet.png";
} else {
img.src = "https://s3.amazonaws.com/i.addtowallet.co/assets/Add_to_Google_Wallet_badge.svg.png";
}
button.style.background = 'none';
button.style.border='none';
button.style.width = '250px';
button.style.height = '72px';
img.style.width = '100%';
img.style.height = '100%';
button.style.cursor = 'pointer';
button.onmousedown = function() {
button.style.transform = 'scale(0.9)';
}
button.onmouseup = function() {
button.style.transform = 'scale(1)';
}
button.onclick = function() {
window.open(buttonUrl, '_blank');
}
}
</script>
<button id="addToWalletButton">
<img id="walletImage" src="" alt="addToWalletButton"/>
</button>
5. Preview, then publish
Use the preview control at the top of the editor, then publish.

Check the published page on a phone
Publish the page, open the live URL on a phone, and tap the link or button. Confirm the pass page opens. Write down the phone model and the browser you used. This article does not publish a device result.
Create Wallet Pass Now