Skip to content

Instantly share code, notes, and snippets.

@paulofierro
Created July 13, 2015 23:12
Show Gist options
  • Save paulofierro/6dbad433720cd4674185 to your computer and use it in GitHub Desktop.
Save paulofierro/6dbad433720cd4674185 to your computer and use it in GitHub Desktop.
iOS Smart App Banner snippet for Squarespace pages
<script>
var meta = document.createElement('meta');
meta.name = 'apple-itunes-app';
meta.content = 'app-id=XXX, affiliate-data=YYY';
document.getElementsByTagName('head')[0].appendChild(meta);
</script>
@lil-steve
Copy link

Hi Paulo! For some reason this code isn't working on my Squarespace site. Is it template specific by any chance? Thank you so much!

@paulofierro
Copy link
Author

@lil-steve it shouldn't be template specific, as all this does is append a <meta> tag to the page.

Did you replace the app and affiliate ID's? If you don't have an affiliate ID then simply replace your app ID like so:
meta.content = 'app-id=MY_APP_ID_GOES_HERE';

You can check it out in action by visiting this page https://jadehopper.com/work/avoidtown on an iOS device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment