Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Realex Redirect and Google Analytics conversions

  • 15-11-2014 5:59pm
    #1
    Registered Users Posts: 186 ✭✭


    Does anyone have a reliable method of tracking conversions with Realex Redirect?

    When a customer on my site clicks 'checkout', they are redirected to Realex's site where they enter their card details.

    Once they successfully pay, Realex calls a PHP script on my server. This script marks the order as complete in the database and then outputs:
    <h2>Payment successful</h2>
    <a href="mydomain.com/thankyou.php?order_id=12345">Click here to continue</a>
    

    Realex then outputs that to the customer's browser. The link brings them back to a page on my server with the Analytics conversion code (javascript), which is dynamically generated using the order_id string.

    The problem is that some people don't bother clicking this link, so even though they have paid, the conversion can't be tracked.

    Does anyone how I can get around this?


Comments

  • Registered Users Posts: 5,999 ✭✭✭Talisman


    Does anyone have a reliable method of tracking conversions with Realex Redirect?

    When a customer on my site clicks 'checkout', they are redirected to Realex's site where they enter their card details.

    Once they successfully pay, Realex calls a PHP script on my server. This script marks the order as complete in the database and then outputs:

    <h2>Payment successful</h2>
    <a href="mydomain.com/thankyou.php?order_id=12345">Click here to continue</a>
    

    Realex then outputs that to the customer's browser. The link brings them back to a page on my server with the Analytics conversion code (javascript), which is dynamically generated using the order_id string.

    The problem is that some people don't bother clicking this link, so even though they have paid, the conversion can't be tracked.

    Does anyone how I can get around this?
    Why can't you add the GA tracking event to the code that displays the link?

    https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce?csw=1


  • Registered Users Posts: 2,342 ✭✭✭red_bairn


    Talisman wrote:
    Why can't you add the GA tracking event to the code that displays the link?


    As Talisman said, do this to your response page and you should be able to record the details.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    Realex loads the code, but the cookie set by GA will not work as realex is a different domain. You can probably get around this with passing vars to the URL.


  • Registered Users Posts: 186 ✭✭That username is already in use.


    Talisman wrote: »
    Why can't you add the GA tracking event to the code that displays the link?

    https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce?csw=1

    Realex doesn't allow javascript. Even if they did, it's a different domain so I don't think Analytics would track the conversion.


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Instead of a link to your page/domain, could you get Realex to serve up an image (from your server) with the order number as a querystring parameter on the image URL.


  • Advertisement
  • Registered Users Posts: 26,556 ✭✭✭✭Creamy Goodness


    Graham wrote: »
    Instead of a link to your page/domain, could you get Realex to serve up an image (from your server) with the order number as a querystring parameter on the image URL.

    This would be the best option.

    Failing that could you redirect the user to the "click here to continue" after 3 or less seconds and then track there. Not ideal but you'd get some tracking.


  • Registered Users Posts: 159 ✭✭magooly


    https://resourcecentre.realexpayments.com/forum/viewtopic.php?f=2&t=12

    See Colins comment from realex above.

    You can initiate a javascript redirect from their Thank you page back to your site. You can pass them product IDs in hidden fields and they will pass them back to you on your landing page where you track the conversion.


  • Registered Users Posts: 5,999 ✭✭✭Talisman


    Realex doesn't allow javascript. Even if they did, it's a different domain so I don't think Analytics would track the conversion.
    GA can be configured to do cross domain tracking.

    You could also implement the tracking yourself on your server with a server side request to GA using the appropriate parameters.


  • Registered Users Posts: 2,342 ✭✭✭red_bairn


    magooly wrote:
    You can initiate a javascript redirect from their Thank you page back to your site. You can pass them product IDs in hidden fields and they will pass them back to you on your landing page where you track the conversion.

    Whose 'Thank You' page?


  • Registered Users Posts: 159 ✭✭magooly


    red_bairn wrote: »
    Whose 'Thank You' page?
    make that 'Payment successful' page hosted by realex


  • Advertisement
  • Registered Users Posts: 186 ✭✭That username is already in use.


    Graham wrote: »
    Instead of a link to your page/domain, could you get Realex to serve up an image (from your server) with the order number as a querystring parameter on the image URL.

    Realex doesn't allow images from external domains. Also, the customer's browser would show "page contains secure and nonsecure items" warning.


  • Closed Accounts Posts: 433 ✭✭MaggotBrain


    Realex doesn't allow images from external domains. Also, the customer's browser would show "page contains secure and nonsecure items" warning.

    Why can't you just do the google analytics call from your PHP script?


  • Registered Users Posts: 186 ✭✭That username is already in use.


    magooly wrote: »
    https://resourcecentre.realexpayments.com/forum/viewtopic.php?f=2&t=12

    You can initiate a javascript redirect from their Thank you page back to your site.

    Realex Redirect doesn't allow javascript.


  • Registered Users Posts: 186 ✭✭That username is already in use.


    magooly wrote: »

    Hmm, having read through that thread you posted again, Colm in Realex says a javascript redirect can actually be run on the response page. This is different to what I was told. I'll give them a shout tomorrow.

    Thanks for the lead!


  • Registered Users Posts: 2,342 ✭✭✭red_bairn


    Hmm, having read through that thread you posted again, Colm in Realex says a javascript redirect can actually be run on the response page. This is different to what I was told. I'll give them a shout tomorrow.


    Javascript can't be sent across in your template for the payments page but when Realex scrapes the content from the response page it can be what you want.


  • Registered Users Posts: 2,342 ✭✭✭red_bairn


    magooly wrote:
    make that 'Payment successful' page hosted by realex


    There isn't a payment successful page by Realex. The success page is the merchants response page that Realex scraped and uses on their own server that is why one would still see the Realex payments page URL above.


  • Subscribers Posts: 1,911 ✭✭✭Draco


    You could also use Google's Measurement Protocol which hooks into GA in your PHP script:
    https://developers.google.com/analytics/devguides/collection/protocol/v1/

    I've used this PHP lib for it before and it produced good results:
    https://github.com/krizon/php-ga-measurement-protocol


  • Registered Users Posts: 88 ✭✭BmCon


    Does anyone have a reliable method of tracking conversions with Realex Redirect?

    When a customer on my site clicks 'checkout', they are redirected to Realex's site where they enter their card details.

    Would you not record this in your database as a started transaction?
    You could also use GA tracking here.
    Once they successfully pay, Realex calls a PHP script on my server. This script marks the order as complete in the database and then outputs:

    And here you are recording the conversion; if you wanted you can record in the Database and using GA tracking.
    <h2>Payment successful</h2>
    <a href="mydomain.com/thankyou.php?order_id=12345">Click here to continue</a>
    
    I would not use this because you are correct people do not click links 100% of the time.
    Also JavaScript is not guaranteed to work on all browsers. I try not to use it where it is important to have that function. Your php will run on your server which will work 100% of the time.

    If you need an output its a straight html output for php which will work on all browsers.
    Does anyone how I can get around this?

    This is my way.


Advertisement