How to insert a tracking variable in an order without using an app?

I’ve been trying to get postback URL’s to work in shopify without installing an app. A little context, a postback URL is when you have a unique ID given to you by a traffic source that gets passed in the URL. Then when someone purchases it does a post request to their server with that unique ID in it, and it triggers a sale. It’s extremely accurate, and avoids all the issues with pixels.

I’ve gotten this far.

  1. I have a unique click ID that loads when a page on shopify loads.
  2. (this part i have not figured out yet). Stripping the unique ID in the variable, and putting it in a parameter that shopify flow recognizes. This needs be updated on a per order basis, and the variable optimally should be overridden when a new click ID happens.
  3. Shopify flow triggers a post to our traffic source on sale with the URL being correct except i need a shopify variable that contains this unique ID as a reference.

How do i get a variable in the URL to be put into a variable that can be read in shopify? I tried using the Marketing referral code under the customerJourneySummary but the problem is that doesn’t get updated until AFTER they purchase so it was basically doing the following workflow

“Referral code is blank, API call triggers, updates referral code”. So the API postback was not working properly because the unique ID was updated after the postback triggers.

Thanks in advance,

1 Like