Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a page with a Google Map (https://agevansville.com/need-help-lets-talk) in the right column which is powered by GetLocations module (https://www.drupal.org/project/getlocations) and Views. However when I have AdvAgg Modifier turned on and settings turned on from different articles I have read to help get the page score up on Google Page Speed it breaks that Google Map. As soon as I turn off AdvAgg Modifier the map returns.
Can anyone help with adjusting the settings so that the Google Map shows up but I still get a good score with having render blocking JS and CCS below the fold?
Comment | File | Size | Author |
---|---|---|---|
#3 | Screen Shot 2016-05-16 at 10.56.46 AM.png | 127.85 KB | ryanfc78 |
#2 | Screen Shot 2016-05-16 at 10.56.32 AM.png | 222.75 KB | ryanfc78 |
Comments
Comment #2
ryanfc78 CreditAttribution: ryanfc78 commentedComment #3
ryanfc78 CreditAttribution: ryanfc78 commentedAnother screen shot
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedIt's most likely move everything to the footer that is causing issues. You can try checking this box first to see if that fixes the issue for you "Put a wrapper around inline JS if it was added in the content section incorrectly"
Comment #5
ryanfc78 CreditAttribution: ryanfc78 commentedI just tried that and it still does not work. It is from moving everything to the footer. I tried all 4 options but the only thing that makes it work again is disabling it.
Does anything need to go in the INLINE WRAPPER SETTINGS field? It talks about var google_conversion_id = XXX; but I don't know where you get the ID.
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commented"Inline skip list for wrapper code" No this used if the inline code can not be wrapped up and ran later. Looking at this and it seems like this should have fixed it; if it's not working then that means the map code is outside of the content areas that advagg scans (in this case a tpl file).
"google_conversion_id" has to do with ads; js ad code is notorious for not working with out of order js execution. This is used as an example of something that breaks when the inline wrapper is enabled.
From my 10 minutes of poking around it appears that the getlocations module expects its js to be in the header and will break if not done so. This happens because the getlocations.js starts by define some variables without first checking to see if they have already been defined.
This is the issue. Inside your HTML above where getlocations.js gets loaded this bit of js code is ran
Drupal.getlocations_data["key_1"] = {"datanum":1,"latlons":[["37.988094","-87.475967","1","","agmarker","nid","",""]],"minmaxes":""};
.Then inside getlocations.js, this is ran.
Drupal.getlocations_data is now empty.
The fix is to change this so it looks like this
There might be other issues as well but this is the first step...
Comment #7
ryanfc78 CreditAttribution: ryanfc78 commentedI changed that, cleared cache and ran cron, but the map still does not show up.
Comment #8
webservant316 CreditAttribution: webservant316 commentedI just ran into this problem... I was able to keep advagg running by disabling a few options under the Modifications tab. Here are the things I disabled...
I don't have any clue why this is the case, but just reporting back what worked for me.
Comment #9
ryanfc78 CreditAttribution: ryanfc78 commentedWish this would work even with JS moved to the footer.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commented#2672308: ReferenceError: Drupal is not defined might be the solution.
Comment #11
danzVP06 CreditAttribution: danzVP06 commentedI tried changing the getlocation.js as per comment #6 and applied the patch from comment #10
The first loading of the website from incognito works fine. but after reloading it or going to other pages, getlocation gives an error on my end.
Update:
I also applied this patch, still nothing.
I tried to make the js inline on specific pages (the ones that has map). It works well. But I don't like making my JS inline because it's a lot of JS that's from different kinds of module
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedIs this still relevant?
Comment #13
mikeytown2 CreditAttribution: mikeytown2 commentedComment #14
mikeytown2 CreditAttribution: mikeytown2 commented