Affirm Promotional Message Not Publishing to Product and Cart Pages

Erin_Neally
New Member
5 0 0

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?  

0 Likes
Alex_Lam
Shopify Partner
87 29 23

Would you have the URLs of the pages where you've tried to add their code to?

Is your store fast enough? Compare your store's speed against hundreds of others for free with our benchmarker - https://www.rvere.com/
0 Likes
Alex_Lam
Shopify Partner
87 29 23

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 -->
Is your store fast enough? Compare your store's speed against hundreds of others for free with our benchmarker - https://www.rvere.com/
0 Likes
Erin_Neally
New Member
5 0 0

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 -->


.

0 Likes
Alex_Lam
Shopify Partner
87 29 23

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",
Is your store fast enough? Compare your store's speed against hundreds of others for free with our benchmarker - https://www.rvere.com/
0 Likes
Erin_Neally
New Member
5 0 0

Thank you Alex - You've been incredibly helpful today. I've reached out to Affirm to get my API credentials straightened out.

0 Likes
wuyanzu-code
New Member
1 0 0

Hello, may I ask you a question?截屏2020-10-09 下午11.45.20.png

0 Likes