• Resolved huddle

    (@huddle)


    We have a client that is using this plugin but wants to add an onclick event to retarget users who subscribe to the list. Is there a way to add the Adsense onclick event to the button in the shortcode?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @huddle,

    Trust you’re doing well!

    I apologize for the late reply. Please let us know more information about what you wish to achieve?

    Are you looking to redirect the subscribers after they will sign up?

    If not, you can add onclick events to the button with the JQuery.

    $(document).ready(function(){
    $(".hustle-button-submit").on("click", function(){
    //your custom function
    });
    });

    Please note, if you have added custom CSS class to the submit button on your end, please replace .hustle-button-submit CSS class with the custom one.

    Please advise,

    Kind regards,
    Nastia

    Thread Starter huddle

    (@huddle)

    Sorry for my late reply as well, I didn’t receive notification for the reply.

    Basically, add this to the button.

    <button onclick="return gtag_report_conversion('https://example.com/your-link')">Submit</button>

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @huddle

    Thank you for response!

    In this case the code that @wpmudev-support9 provided earlier would be a solution. You’d want to “merge” it with your “gtag_report_conversion()” call like this

    $(document).ready(function(){
    $(".hustle-button-submit").on("click", function(){
    	gtag_report_conversion('https://example.com/your-link');
    });
    });

    You can apply such code to the site for example via “Custom JS” option of your theme – if your theme provides such option – on one of numerous “custom js” type plugins.

    Best regards,
    Adam

    Thread Starter huddle

    (@huddle)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Adsense tag to button’ is closed to new replies.