Rich-text Reply

Purchase Recorded Multiple times

jmcmains 04-21-16

Purchase Recorded Multiple times

I'm having an issue where a purchase is recorded multiple times because the customer lands on the receipt page, and once or so a day the page will refresh and rerecord the purchase. Unique visitor tracking only seems to fix this problem within a 24 hour window, and then the purchase is counted again. Is there a way to add a key or something like that to the purchase so that optimizely knows it has already been counted?

 

Thanks for any help!

Level 1

AllisonR 04-22-16
 

Re: Purchase Recorded Multiple times

Hi there,

 

Optimizely will automatically de-duplicate conversions that occur from the same visitor. This is tracked using the optimizelyEndUserId cookie which lasts in the visitor's browser for 10 years. De-duplication applies to all conversion events, with the exception of revenue.

 

Are you referring to the revenue tracking call existing on the receipt page? If so, we reccommend making sure that your revenue goal is implemented in such a way that it can only fire once for every successfully placed order. You might choose to do this by looking at successful form submissions or by verifying the order number, but there are many ways to achieve this. 

 

If you don't have access to a technical resource to help set this up, you can always remove duplicate orders from your results using an offline conversion as we describe here

 

Hope this helps!

 

Best,

 

Allison
Sr. Technical Support Engineer
Optimizely | EMEA

Allison
Sr. Technical Support Engineer
Optimizely | EMEA
Optimizely
MJBeisch 04-22-16
 

Re: Purchase Recorded Multiple times

I just had to resolve this exact same issue for one of the sites that I work on. To resolve the issue, I created a "sanity check" using a cookie. Here's some example code (that would go on your site's summary page):

 

<script type="text/javascript">
    if( readCookie("orderCheck") != "ORDER_NUMBER_HERE" ) {
        createCookie("EOSorderCheck","ORDER_NUMBER_HERE",3650);
            window.optimizely.push(['trackEvent', 'conversion', revenueInCents]);
            window.optimizely.push(["trackEvent", "order_conversion"]);
    }
</script>

 

Step by step process:

  1. Get the value of the cookie (in this case "orderCheck")
  2. If the value of the cookie does not equal the current order number, save the order number to the cookie and submit conversion events to Optimizely
Matt Beischel - E-Commerce Optimization Specialist CohereOne

Level 2
JasonDahlin 04-22-16
 

Re: Purchase Recorded Multiple times

@MJBeisch - Excellent example.  But or sites that are wary of using cookies when they don't need to, all modern browsers support localStorage and sessionStorage which may be a viable alternative to supressing the refresh:

 

 

if (typeof window.sessionStorage == "object") {
  if( window.sessionStorage.last_order != "ORDER_NUMBER_HERE" ) {
    window.sessionStorage.last_order = "ORDER_NUMBER_HERE";
    window.optimizely.push(['trackEvent', 'conversion', revenueInCents]);
    window.optimizely.push(["trackEvent", "order_conversion"]);
  }
}

 

If the order confirmation page persists across browser sessions, you'll want to use localStorage instead of sessionStorage. (Check caniuse.com for browser compatibility)

 

 

And, if you are concerned about browsers that don't support either of these storage objects, you could add the cookie part as an "else" statement.

--Jason Dahlin
Analytics and Testing Guru Smiley Happy
MJBeisch 04-22-16
 

Re: Purchase Recorded Multiple times

Yeah, session and local storage are viable alternatives. In my case I use cookies because the order confirmation page of the site I was working on can persist across sessions, and users were somewhat likely to be bookmarking that page so that they could return to it later. I didn't want a scenario where a user returns to their order confirmation 10 days later and ends up submitting duplicate conversion data.

 

You also have the option of encrypting the data before saving it to the cookie, or saving a timestamp instead of the order number.

Matt Beischel - E-Commerce Optimization Specialist CohereOne

Level 2