Hello, I've activated Affirm on our site and seemingly followed the coding instructions to add the promotional messaging to the individual product and cart pages. However, it is not publishing so I am obviously doing something incorrect in the coding. Affirm provides all of the instructions to add this to your Shopify site specifically - no additional coding should be needed. I notice it is an option at checkout- but the appeal with Affirm is that the customer has the option to see what payments over time might look like at each stage of the customer experience, which hopefully encourages purchase and no abandoned cart. Any others having this issue and/or advice?
Would you have the URLs of the pages where you've tried to add their code to?
The Affirm script should be below the <head> tag, like so:
<head> <!-- Affirm --> <script> _affirm_config = { public_api_key: birdbelleshop@gmail.com, script: "https://cdn1.affirm.com/js/v2/affirm.js" }; (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready"); // Use your live public API Key and https://cdn1.affirm.com/js/v2/affirm.js script to point to Affirm production environment. </script> <!-- End Affirm -->
Pasted that in exactly as you had it below the <head> tag on the theme.liquid tab. Still not updating to include on product page
@Alex_Lam wrote:The Affirm script should be below the <head> tag, like so:
<head> <!-- Affirm --> <script> _affirm_config = { public_api_key: birdbelleshop@gmail.com, script: "https://cdn1.affirm.com/js/v2/affirm.js" }; (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready"); // Use your live public API Key and https://cdn1.affirm.com/js/v2/affirm.js script to point to Affirm production environment. </script> <!-- End Affirm -->
.
Ahh I see, in the initial portion of the affirm code, birdbelleshop@gmail.com was added as the public API key. This doesn't look like a traditional API key, I suspect it's something else that Affirm provides in their app or website. It's usually a long string of numbers and characters that's unique to you. Also, that property needs to be in double quotes. So if your api key is abc123def456, it needs to be added as:
public_api_key: "abc123def456",
User | Count |
---|---|
25 | |
24 | |
23 | |
19 | |
13 |