Jump to content

Using Source URL to drive Eventbrite Sign-Up embed button

Recommended Posts

Hello, 

 

I was hoping if I could get some help with the following case:

I was wondering whether it is possible to use the Source URL section in a Events page to drive the link that goes into the Code Embed button for an Eventbrite sign-up.

Currently when creating a new event and updating the embedded Tickets button from Eventbrite me and my team would have to also change the code inside the embed block. Which currently is as follows:

Website URL - https://london.siggraph.org/events/drink-draw-march-2023

<!-- Noscript content for added SEO -->
<noscript><a href="https://www.eventbrite.co.uk/e/drink-draw-march-2023-tickets-559358595617" rel="noopener noreferrer" target="_blank">Buy Tickets on Eventbrite</a></noscript>
<!-- You can customise this button any way you like -->
<button id="eventbrite-widget-modal-trigger" type="button">Get Tickets</button>

<script src="https://www.eventbrite.co.uk/static/widgets/eb_widgets.js"></script>

<script type="text/javascript">
    var exampleCallback = function() {
        console.log('Order complete!');
    };

    window.EBWidgets.createWidget({
        widgetType: 'checkout',
        eventId: '559358595617',
        modal: true,
        modalTriggerElementId: 'eventbrite-widget-modal-trigger',
        onOrderComplete: exampleCallback
    });
</script>

I was wondering if on the second line instead of having to edit the embed block if it could somehow read the Source URL given in the settings for the specific Event.

If you have a better idea on how to do this I would also appreciate that. Hope I have been clear and thanks in advance for any help provided!

 

Best,

Bobby 

Screenshot 2023-03-06 at 15.48.03.png

Screenshot 2023-03-06 at 15.48.10.png

Screenshot 2023-03-06 at 15.51.36.png

Edited by BobbyGeorgiev
added site link

Photographer and 3D Animation Artist - https://boyangeorgiev.com/

Link to comment

So I did a little nosing around and have found where the event Id lives.

The way I see it working is maybe by somehow passing a parameter from our event page to the checkout embed code. 
As it stands the Eventbrite Embed checkout code goes like this:
 
<!-- Noscript content for added SEO -->
<noscript><a href="https://www.eventbrite.co.uk/e/bring-your-own-animation-march-2023-tickets-567045748097" rel="noopener noreferrer" target="_blank">Buy Tickets on Eventbrite</a></noscript>
<!-- You can customise this button any way you like -->
<button id="eventbrite-widget-modal-trigger-567045748097" type="button">Buy Tickets</button>

<script src="https://www.eventbrite.co.uk/static/widgets/eb_widgets.js"></script>

<script type="text/javascript">
    var exampleCallback = function() {
        console.log('Order complete!');
    };

    window.EBWidgets.createWidget({
        widgetType: 'checkout',
        eventId: '567045748097',
        modal: true,
        modalTriggerElementId: 'eventbrite-widget-modal-trigger-567045748097',
        onOrderComplete: exampleCallback
    });
</script>
 
As I see the only info that relates to which event the button would lead to I have made bold. So I was wondering if that can take a parameter that is on the website instead so that when we create new events I can pass the event Id info in the source url, rather than having to edit the embedded button code. image.png.a0896f2a4adc14ab4e5408b802c87cab.pngimage.thumb.png.5a34771ba5cbbe76a69ac8cc3fe7de23.png
 
Thanks in advance for any help. 
 
Best,
Bobby

Photographer and 3D Animation Artist - https://boyangeorgiev.com/

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.