Skip to content

Tracking Sales with UTM Parameters using Buy Button #861

Open
@TropicSnowman

Description

@TropicSnowman

Hello,

I am trying to pass UTM parameters in the Buy Button checkout URL to track sales from different sources. For example, I will have the same Buy Button Code on three other sites and want to track sales for each. I have tried manipulating the URL using the following event function, but the landing_site or UTM tracking parameters are not working or do not work with the Buy Button. For context, I use the same code for the Online Store and can see tracking in the reports. Also, the code below allows me to pass the URM parameters in the URL. However, Shopify is not recognizing them in the reports.

"events": {
      afterInit: (cart) => {
        cart.onCheckout = () => {
          const checkoutUrl = cart.model.webUrl + '?utm_campaign=dune_test&utm_id=12345&utm_medium=affiliate_buybutton&utm_source=fandango';
          cart.checkout.open(checkoutUrl);
        };
      },
    },

Does anyone know or have had experience or success tracking sales with Google Analytics or UTM parameters from Buy Button?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions