Optimize
3.5K members online now
3.5K members online now
Learn how to create your first experiment and get tips on creating A/B, redirect, and multivariate tests.
Guide Me
star_border
Reply

JavaScript size exceeds limit

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Is there a way to increase the JavaScript size limit for Google Optimize?

I work on a CRO and UX company that mainly works on 1 javascript file to customize the entire page.

 

Never had this issue with other tools like Optimizely, AB Tasty and Monetate.

At the moment I had to split my code in 5 different sections just to made work.

 

Best regards,

Pedro

JavaScript size exceeds limit

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

Same problem here. The Code option in Optimize seems to be quite unfriendly. While any test that's slightly above 'change the button colour' will require a code-based solution.

JavaScript size exceeds limit

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

I'm also facing JavaScript size exceeds limit issue. I've a new component (range slider) in variation when I try to add js library it shows JavaScript size exceeds limit error. Did you find any workaround?

JavaScript size exceeds limit

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Same issue here

Re: JavaScript size exceeds limit

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Currently I've solved this issue by injecting multiple blocks of Javascript, which seems to work ok.

 

  • Make sure to minify / obfuscate your code to save as much space as possible to begin with.
  • Inject your Javascript into multiple blocks, even if it's on the same element:
    • e.g. Add new javascript, as selector choose body (or whichever you want) and set the first bit of your script
    • repeat for other bits

If you do that, the editor will accept more code. Make sure you don't run into timing issues due to splitting the code, and you're good to go! (Maybe define functions in 1 block, and use them in another)

 

It's not pretty, but it's functional.

JavaScript size exceeds limit

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

@Davy S tried that solution too, but my JS is big enough to block the whole experiment.

 

ScreenShot: https://www.screencast.com/t/32i5PBrj