HOW TO GUIDE: Track Referrer URL with Google Analytics / Tag Manager via Shopify Lite Buy Button

Highlighted
Tourist
7 0 4
Highlighted
New Member
2 0 2

If been following this topic, Google Analytics Tracking with Shopify Buy Button for a long time and surprised that there really isn't any official support. Anyway this post is helpful! I also wanted to share that with some of our own torubleshooting and trying to get FB tracking pixels to work you can actually "embed" the Shopify Buy Button as part of the DOM and not rely on the iframe injection.

 

https://shopify.github.io/buy-button-js/advanced/

 

There are a few things...

 

You can add DOM events (if you continue to use the iframe injection)

 

var product = {
  DOMEvents: {
    'click .button': function (event) {
      myAnalyticsLibrary.track()
    }
  }
}

or if you declare that you don't want to use the iframe at that point the markup is part of the DOM and you could add any type of custom event via GA or GTM.

 

var options = {
  product: {
    iframe: false
  },
  cart: {
    iframe: false
  }
}

Hope this helps or sparks a new idea.

Highlighted
New Member
4 0 0

@AtlasWebmaster thanks for this -- did my best to follow your steps exactly and still struggling to get the referral information to come through. Wondering if I can contact you offline for a paid hour or two to help me get through this issue and get analytics working. Been spinning my wheels on this for a few days now.

On GA i can verify that it is tracking when someone is in the shopping cart/checkout sequence via the realtime dashboard and the content tab but I cannot get ecommerce data to come through as being tagged to any UTM data.

frustrated,

Nathan (nathan@currentlabs.io)

0 Likes
Highlighted
Tourist
7 0 4

I SOOO wish I could! But I've got 3 kids home for "distance learning" right now. Sorry. :(

Highlighted
New Member
4 0 0

 


@AtlasWebmaster wrote:

I SOOO wish I could! But I've got 3 kids home for "distance learning" right now. Sorry. :(


Ha! totally get it. I'll keep poking around and figure it out eventually!

0 Likes
Highlighted
New Member
4 0 0

Do you need to enable some kind of cross domain tracking or conversion linker setup in GTM to make this work? Potentially a special referral exclusion in GA properties?

while i can see that google analytics realtime is tracking the checkout pages, they continue to not be taking the referral UTM information.


@naterock101 wrote:

 


@AtlasWebmaster wrote:

I SOOO wish I could! But I've got 3 kids home for "distance learning" right now. Sorry. :(


Ha! totally get it. I'll keep poking around and figure it out eventually!


 

0 Likes
Highlighted
Tourist
7 0 4

Nope, I didn't need to do cross-domain tracking. Those methods failed for me, in fact.

0 Likes
Highlighted
New Member
3 0 0

Hi!! That was super helpful!!  I did it !! (It wasn't easy for me, but I did it!!) 

I have one more question. In my blog posts I use different buy buttons to link for different products in the same post. So now I know from what post comes the clicked button, but I don't know which product they chosed. 

It would be very helpful if you could tell me which  Label to use (maybe is a dumb question). 

Thank you !! 

0 Likes
Highlighted