Consent Pro V2 Essential Scripts

Description

I have scripts that are custom js that don’t need to be blocked by Consent Pro. I am not sure how I create a bypass for these scripts as I did in Consent Pro V1. There I either did not wrap them in fs-cc attrs or added them as essential scripts. These scripts are now broken and I am not sure how to fix them.

Expected Behavior

I want to have scripts that run outside of being managed by Consent Pro and aren’t awaiting Consent Pro to load. OR - how do I manually set scripts as essential and then what event am I waiting on to know that my script can be kicked off?

Hey @bhol!

Consent Pro should not be blocking non-tracking scripts :thinking:

Could you share your link so we can have a look? Alternatively, you can try wrapping the scripts in the Consent Pro API. This way, the scripts will run only after Consent Pro has finished loading.

The API looks like this


<script>
  // Access Consent Pro API
  window.FinsweetConsentPro = window.FinsweetConsentPro || [];
  window.FinsweetConsentPro.push([
    'consent',
    (instance) => {
      console.log('Consent instance:', instance);
    },
  ]);
</script>


Let me know how it goes!

@Support-Luis Here is a link to one of our product pages. There is a script in the before footer that takes the assigned value from a header script for window.SIGNUP_ROUTE and then sets our nav links - so our nav links are flexible. Those worked up until the changes and was not sure what changed - maybe it is the handler not being setup as it did before.

Thanks @Support-Luis !

@Support-Luis just to add, the Signup button in the upper right should have been updated to go to this link: Enji

Hey @bhol! Thank you for sharing!

I think there is a selector mismatch, your nav button does not match this selector

e = ['.navigation-wrapper .navsignupbtn', '.footer .footersignupbtn'];

A button that matches the selector can be found in the footer with the correct link

You can add the classes needed to the button or use other selectors in your code. I suggest using attributes like data-SIGNUP_ROUTE , as there is less chance that a design change will break the selectors.

I hope this helps!

Thanks @Support-Luis for pointing out the obvious - my bad! It appears someone removed the classes from that button.