Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattlebel/7e9b2d037ac135275bc06dce83c7c343 to your computer and use it in GitHub Desktop.
Save mattlebel/7e9b2d037ac135275bc06dce83c7c343 to your computer and use it in GitHub Desktop.
Behind The Checkout - Only fire conversion scripts / pixels on first visit to the Order Status page
{% if first_time_accessed %}
<!-- Scripts you only want to run on first checkout confirmation -->
<!-- An example tracking pixel - be sure to remove this when copying this example -->
<img src="https://www.tracking.com/pixel.gif?amount={{ total_price | money_without_currency }}&amp;order-id={{ order_number }}&amp;currency={{ currency }}" height="1" width="1" />
{% else %}
<!-- Scripts you want to run on every visit to confirmation page -->
<!-- (like when a customer clicks the "View Order Status" button in their confirmation email) -->
<!-- It's possible that this section remains blank, but I would leave the above comment as context for future Marketers / developers -->
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment