Adding javascript in the footer
-
@pitaj said in Adding javascript in the footer:
@torn2 can you share the code? Feel free to anonymize it.
This is the code needed:
<div id="amzn-assoc-ad-8c98c907-d21d-480d-a0fe-47c5aeaf7dee"></div><script async src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId=7c08b907-d21d-480d-b0fe-47c5aeaf7dee"></script>
-
@torn2 you should be able to just place that in a footer widget. I'd try placing the div in the footer and the script in the custom HTML though.
-
@pitaj said in Adding javascript in the footer:
@torn2 you should be able to just place that in a footer widget. I'd try placing the div in the footer and the script in the custom HTML though.
If I place the script part in the custom javascript, I get this error?
-
@torn2 I specifically said to place the script in the custom HTML. It might be called custom header.
-
@pitaj said in Adding javascript in the footer:
@torn2 I specifically said to place the script in the custom HTML. It might be called custom header.
I placed the div in the global footer widget, placed the script in the custom header. Get this error in custom header:
-
@torn2 can you take a little larger screenshot so I can see the context that error is in?
-
-
@torn2 I think you can ignore that error. It won't prevent you from enabling or saving the code AFAIK. Try it out.
-
Ok have you tried embedding the whole thing in the footer HTML? What is the script and stuff for? Analytics? Are there any alternatives that don't require a script?
-
@pitaj said in Adding javascript in the footer:
Ok have you tried embedding the whole thing in the footer HTML? What is the script and stuff for? Analytics? Are there any alternatives that don't require a script?
Yes, it breaks certain part when it is placed in that widget. It's so that when users from other countries click on the link for amazon they get redirected with the US referrer code link embedded their countries amazon store.