Re: Shopify Trekkie Google Gtag Pixel

How can I modify values in the Google Gtag Pixel with Trekkie?

aleksv
Shopify Partner
1 0 2

The shopify trekkie script inserts a "Google Gtag Pixel", but I have no idea where it is taking the data from. I would would like to change the values. 

 

Any idea?

Replies 17 (17)

Jay_JUNKbrands
Shopify Partner
7 1 2

I'm not sure I necessarily need to modify its values, but I sure would like some clarification on trekkie. It's loading our global tag in the footer, which concerns me that it won't catch everything before it without our duplicate manual insertion of the global tag. Shopify is frustratingly silent as far as documentation goes for this...

Josh_Uebergang
Shopify Partner
1022 44 276

What's the website and the code you're referring to? Shopify does not insert any gtag pixel... unless they've just started to roll something out to a select few stores.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
mrPerezInc
Visitor
1 0 1

I have a similar issue.

 

You can see it at https://theboholab.com/

 

I've removed all instances of Google analytics UA ID, Remarking, google ads codes from the Shopify theme files and checkout additional scripts.

 

I still get this portion Google Gtag Pixel loading from Trekkie

 

"Google Gtag Pixel":{"conversionId":"799551677","eventLabels":[{"type":"page_view","action_label":"AW-799551677\/DBcNCICx3owBEL3hoP0C"},{"type":"purchase","action_label":"AW-799551677\/AGReCIOx3owBEL3hoP0C"},{"type":"view_item","action_label":"AW-799551677\/RM0zCIax3owBEL3hoP0C"},{"type":"add_to_cart","action_label":"AW-799551677\/MXisCImx3owBEL3hoP0C"},{"type":"begin_checkout","action_label":"AW-799551677\/S-6SCIyx3owBEL3hoP0C"},{"type":"search","action_label":"AW-799551677\/VFQUCI-x3owBEL3hoP0C"},{"type":"add_payment_info","action_label":"AW-799551677\/agKgCJKx3owBEL3hoP0C"}],"targetCountry":"CA"}

 

{"Trekkie":{"appName":"storefront","development":false,"defaultAttributes":{"shopId":1027899510,"isMerchantRequest":null,"themeId":32197509238,"themeCityHash":5158894345615873504}},"Performance":{"navigationTimingApiMeasurementsEnabled":true,"navigationTimingApiMeasurementsSampleRate":1.0},"Facebook Pixel":{"pixelIds":["264335211120899","334310230658336"],"agent":"plshopify1.2"},"Google Gtag Pixel":{"conversionId":"799551677","eventLabels":[{"type":"page_view","action_label":"AW-799551677\/DBcNCICx3owBEL3hoP0C"},{"type":"purchase","action_label":"AW-799551677\/AGReCIOx3owBEL3hoP0C"},{"type":"view_item","action_label":"AW-799551677\/RM0zCIax3owBEL3hoP0C"},{"type":"add_to_cart","action_label":"AW-799551677\/MXisCImx3owBEL3hoP0C"},{"type":"begin_checkout","action_label":"AW-799551677\/S-6SCIyx3owBEL3hoP0C"},{"type":"search","action_label":"AW-799551677\/VFQUCI-x3owBEL3hoP0C"},{"type":"add_payment_info","action_label":"AW-799551677\/agKgCJKx3owBEL3hoP0C"}],"targetCountry":"CA"},"Session Attribution":{}}

 

I want to get ride of them. 

KabahCortes
Visitor
1 0 0

I have the exact same issue. Is there anyone with the fix? Its giving me a double analytics error

Josh_Uebergang
Shopify Partner
1022 44 276

The code you provided looks to be Google Ads tracking. I suspect that's from the Google Shopping channel/app done by Shopify. Shopify automatically sets up Google Ads tracking when you use it. Remove the channel/app if you don't use it, and I think it should go away.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
mktaha
Visitor
2 0 1

But the Google app asks for all your account information and you provide it... and it's not what is showing up with the chrome extension.

RobertJC
Tourist
4 0 1

Did anyone ever solve this or work out where it is getting the code from as it bears no relation to my actual tracking code.

ogeid
Shopify Partner
68 0 23

The replace code is not working for me. Anyone have a solution for this issue that works?

D.E.W. L.A. - Web Design
https://dew.la
Ketul_Patel
Visitor
1 0 9

Why not post the answer here, to help the community?

Kneeko
Shopify Partner
7 0 7

Depending on the content you need replacing you can use the replace function within the {{ content_for_header }}

 

First you would need to comment it out:

 

{% comment %}{{ content_for_header }}{% endcomment %}

 

and directly beneath it:

 

{{ content_for_header | replace:'originalContent', 'replacementContent' }}

 

wherein originalContent would be the thing you are looking to replace and replacementContent its replacement

 

For example, if you wanted to disable the Google Gtag Pixel within Trekkie in order to use your own hard coded scripting you could nullify that variable by doing the following:

 

{{ content_for_header | replace:'Google Gtag Pixel', 'Null Google Gtag Pixel' }}

 

if more than one thing needs replacing:

 

{{ content_for_header | replace:'Google Gtag Pixel', 'Null Google Gtag Pixel' | replace:'Facebook Pixel', 'Null Facebook Pixel' }}

 

and so forth; this essentially renders that code useless within the "Trekkie" script.

 

It's not an ideal solution but it gets the job done.

CarloMT
Visitor
2 0 1

Great, it works! But the problem is still present in the checkout page. Basically, using this solution you solve the problem on all the pages excluding the checkout. Do you have any idea about the reason?

Tks

Kneeko
Shopify Partner
7 0 7

If you are on Shopify Plus: on checkout.liquid the code gets moved from {{ content_for_header }} to {{ tracking_code }}

 

{% comment %}{{ tracking_code }}{% endcomment %}
{{ tracking_code | replace: 'Google Gtag Pixel', 'Null Google Gtag Pixel' }}  

 

If not on Shopify Plus, there is not much that can be done here.

CarloMT
Visitor
2 0 1

Tks, I'm not on Shopify Plus 😞

1080
Shopify Partner
301 9 64

@Kneeko   I have shopify basic plan, we have ga4 implemented, but shopify also loading the trekkie shopify inbuilt how to disable that ?

auerhahn
Tourist
7 0 2

Same issue here, have you found any solution?

1080
Shopify Partner
301 9 64

@Kneeko  I added the same code but still shopify was render there , 

trekkie.load(
      {"Trekkie":{"appName":"storefront","development":false
1080
Shopify Partner
301 9 64

@Kneeko   @Josh   @everyone  
i am confirm the we can't modify the header object. 

I am sharing the test code with console out put.

{% if content_for_header %}
  <script>
let shopi_code = {{ content_for_header | escape | json }}
    console.log("Shopify content_for_header:", JSON.stringify(shopi_code) );
 let shopi_code2 = {{ content_for_header | replace:'Google Gtag Pixel', 'Null Google Gtag Pixel' | replace:'Facebook Pixel', 'Null Facebook Pixel' | escape | json }}
  console.log("Shopify content_for_header:", JSON.stringify(shopi_code2) );
  </script>
{% endif %}