Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/12/2018 : 06:42:34
Hey Guys,
This piece of code is producing javascript that looks something like this: [code]<script type="text/javascript">/* <![CDATA[ */ pIX[2]=0;pIM[2]='https://www.domainname.com/prodimages/image1.png*https://www.domainname.com/prodimages/image2.png*'; /* ]]> */</script>[/code]
This is problematic because Google (and presumably other search engines) are reading this javascript and then trying to access the images, not understanding that the '*' character is an array separator.
For example, this is a URL that Google is telling me is a 404 error: https://www.domainname.com/prodimages/image1.png*https://www.domainname.com/prodimages/image2.png*
Not only is there actually 2 separate images there, but it's looking for the SINGLE images with '*' at the end as well.
This, of course, can have consequences for us if Google sees what looks like 404s on all our product pages.
Is it not possible to do this in a more SEO friendly way like: ‘http://domain/image1.png’, ‘http://domain/image2.png’,
- Graham Slaughter
|
Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/12/2018 : 06:52:13
I can see that this was previously handled a different way with "\\" as the separator.
The old method is also a bit broken unless Google and other search engines KNOW to separate URLs based on [code]\\[/code]
Why not use something like [code]','[/code]
Edited by - Graham Slaughter on 11/12/2018 06:52:34
|
Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/13/2018 : 09:21:29
Any thoughts on this?
|
Andy
ECT Moderator
95440 Posts |
Posted - 11/13/2018 : 09:52:39
|
Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/13/2018 : 11:23:58
Sure thing. I would have put it in there in the first place, but it seems more like a bug than a feature suggestion. It isn't like it affects the functionality of the website (which works great!), it just makes it less search engine friendly in its' current form.
- Graham Slaughter
|
Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/19/2018 : 15:18:05
Would you mind moving it to the suggestions? I've looked at it myself and I think it is beyond me to reprogram that to use a different separating character. I've only moved one of our websites to the new code, but Google is blowing up with reports of increased 404 errors on the website. That CANT be good for SEO.
- Graham Slaughter
|
dbdave
ECT Moderator
USA
10567 Posts |
Posted - 11/19/2018 : 15:37:56
While we are on this topic, for a while I thought I had some javascript error on my end, until I saw it on the ect demo site. I see this in the console on all product detail pages. It does not seem to cause any problems that I can see. But it is showing as an error.
Content Security Policy: The page’s settings observed the loading of a resource at self (“script-src”). A CSP report is being sent. Source: onclick attribute on A element. FASTBUTTON
|
Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/19/2018 : 16:30:16
Got a link?
|
dbdave
ECT Moderator
USA
10567 Posts |
Posted - 11/19/2018 : 17:11:07
http://www.ectdemostore.com/magic-slideshow.asp
|
Graham Slaughter
Ecommerce Template Expert
840 Posts Pre-sales questions only (More Details...)
|
Posted - 11/19/2018 : 17:32:05
This appears to reference the issue: https://developers.google.com/web/fundamentals/security/csp/#inline_code_is_considered_harmful
Basically it's just a warning that there is INLINE javascript instead of only file based javascript.
File based is considered best practice, but I dont know how you could do that javascript without inlining it as it's dynamically created.
As best I understand, you're just seeing a warning https://dev.to/mattferderer/what-is-csp-why--how-to-add-it-to-your-website-28df
- Graham Slaughter
|
Vince
Administrator
43124 Posts |
Posted - 11/20/2018 : 02:54:20
|
|
|