All Collections
Guides / Tutorials / FAQ
Timelines
Registration
How To Capture A Value On Registration And Use It With Your Webinar Call-To-Action (CTA)
How To Capture A Value On Registration And Use It With Your Webinar Call-To-Action (CTA)

Want to Incorporate an AffID or TrackingID into your CTA link? Here's how...

AEvent avatar
Written by AEvent
Updated over a week ago

ADVANCED: FOR DEVELOPERS ONLY

In this tutorial, you'll learn how to capture a specific value during the registration process and use it with your webinar Call-To-Action (CTA). By implementing a special JavaScript code, you can add important tracking information, such as affiliate IDs or tracking IDs, when registrants interact with your CTA. This tutorial will enable you to personalize your CTAs and track user engagement effectively.

By following this tutorial, you'll be able to:

  1. Capture a custom value during the registration process

  2. Retrieve and save the captured value using JavaScript

  3. Implement the JavaScript code on your confirmation page

  4. Set up personalized CTAs with the captured value

Step-By-Step Tutorial:

Step 1: Set up Custom Value Capture

  • Go to the 'Registration' section of the timeline you're building.

  • Click "Add Registration Field".

  • Create a new custom form field and name it accordingly (e.g., "hop")

  • Select the "Query" option to capture the value.

  • Click "Add."

Step 2: Retrieve the Captured Value

  • Navigate to the "Confirmation" tab in AEvent.

  • Go to the code section of the page.

  • Locate the dynamic value that was captured (e.g., "hop") and copy it.

  • Paste the captured value into a notepad or text editor for later use.

Step 3: Implement the JavaScript Code

Copy the code below and paste it into a Notepad or another text editor.

(DISCLAIMER: We will not be able to offer support with this function)

<html>
<head>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>

<!-- Begin AEvent Code -->

INSERT YOUR AUDIENCE TRACKING SCRIPT HERE

<!-- End AEvent Code -->

<div id="ae_hop" style="display:none;">INSERT YOUR CUSTOM VALUE HERE</div>

<script type="text/javascript">

jQuery(function() {
var flagcount=0;
var noaff=true;
function checkFlag() {
var checkit=jQuery("#ae_hop").text();
noaff = checkit.includes('{{');
if(noaff == true && flagcount<5) {
window.setTimeout(checkFlag, 500);
flagcount++;
}
else {
if (noaff)
document.location.href = 'https://CHECKOUT_LINK_HERE_WITHOUT_AFFILIATE';
else
document.location.href = 'https://CHECKOUT_LINK_HERE_WITH_AFFILIATE?hop='+checkit+'/';
}
}
checkFlag();
});
</script>
</body>
</html>
  • Replace the "INSERT YOUR AUDIENCE TRACKING SCRIPT HERE"

    • with the "Full Pixel Code".

    • Go to Code under the Audience Pixel tab placeholder, copy and paste the code.

  • Replace the "INSERT YOUR CUSTOM VALUE HERE."

    • This is what we created above in Steps 1+2 {{!subscriber-hop}}.

  • Replace the "CHECKOUT_LINK_HERE_WITHOUT_AFFILIATE."

    • You need to add your cart URL here.

  • Replace the "CHECKOUT_LINK_HERE_WITH_AFFILIATE?hop='+checkit+'/';

    • Replace the Bold text again with the cart URL, but keep "?hop='+checkit+'/';" at the end.

  • Once all the code is updated, it should look more like this.


In this tutorial, you learned how to capture a custom value during the registration process and use it with your webinar call-to-action (CTA). By implementing a JavaScript code on your confirmation page, you can retrieve the captured value and personalize your CTAs with important tracking information.

This enables effective user tracking and enhances the overall engagement of your webinars or events. Implement this code and enjoy the benefits of targeted and customized CTAs for your registrants.

BONUS CODE: Want to replace 2 values in the CTA? Use the code below following the same structure as we instructed above.

<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>

<!-- Begin AEvent Audience Tracking Code -->
INSERT YOUR AUDIENCE TRACKING SCRIPT HERE
<!-- End AEvent Audience Tracking Code -->


<script type="text/javascript">
jQuery(function() {

var flagcount=0;
var noaff=true;

function checkFlag() {

var checkit=jQuery("#ae_hop").text();
var campaign = jQuery("#ae_campaign").text();

noaff = checkit.includes('{{') || campaign.includes('{{');

if(noaff == true && flagcount<5) {
window.setTimeout(checkFlag, 500);
flagcount++;
}
else {
if (noaff)
document.location.href = 'https://CHECKOUT_LINK_HERE_WITH_AFFILIATE_AND_TRACKING/checkout?affiliate=unknown&tracking=unknown';
else
document.location.href = 'https://CHECKOUT_LINK_HERE_WITH_AFFILIATE_AND_TRACKING/checkout?affiliate='+checkit+'&tracking=' + campaign + '/';
}
}
checkFlag();
});
</script>

<div id="ae_hop" style="display:none;">INSERT YOUR CUSTOM VALUE HERE</div>
<div id="ae_campaign" style="display:none;">INSERT YOUR SECOND CUSTOM VALUE HERE</div>
Did this answer your question?