Adding Google event snippet to "thank you" -page

Solved

Adding Google event snippet to "thank you" -page

Kjankko-US
Shopify Partner
242 4 42

Hi,

 

I need to track leads (conversions) on my Shopify website. I have made Google account and created a conversion action. The next step is to add Google's Event snippet to my "Thank you" -page's <header>

 

The problem: "Thank you" -page is made in the basic Shopify page (Turbo theme) -> There is no place to add that Event snippet, because the code template looks:

 

testingggg.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Can I create some rule, for example: "If the page's title is: "Thank you" -> show this Event snippet"?

 

Any help is highly appreciated!

Accepted Solution (1)
FirstMatsUK
Excursionist
24 2 13

This is an accepted solution.

That's right, the code will look something like this

 

{% if template contains 'thank-you-tracked' %}
{% include 'your-snippet-with-the-tracking-code' %}
{% endif %}

 

Just put that in the <head> section on theme.liquid and it should (... should!...) work

View solution in original post

Replies 7 (7)

FirstMatsUK
Excursionist
24 2 13

Have you tried injecting the code only on that page using Google Tag Manager?

Kjankko-US
Shopify Partner
242 4 42

No I haven't tried. I have the Tag Manager also. Can I add the Tag manager's -tag to other place thank <header>?

 

For example "Content" -section (<>) for that specific page?

 

Does it track conversions then as it should?

 

testre.png

FirstMatsUK
Excursionist
24 2 13

Might need to do it with a snippet.

 

So the snippet contains the code you need for the conversion tracking

Then in the theme.liquid file you'd use an include/otherwise string that says if the template includes 'article_template' then include the snippet within the head section.

 

If that makes sense?

Kjankko-US
Shopify Partner
242 4 42

Hi,

 

That's maybe something I thought myself. So, "if the page's title is Thank you -add this event snippet to header"

In other pages the event snippet won't show. Only that one page where the lead redirect after submit the contact form (contact form isn't Shopify's own..works better than original Shopify).

FirstMatsUK
Excursionist
24 2 13

This is an accepted solution.

That's right, the code will look something like this

 

{% if template contains 'thank-you-tracked' %}
{% include 'your-snippet-with-the-tracking-code' %}
{% endif %}

 

Just put that in the <head> section on theme.liquid and it should (... should!...) work

jazz-jay
Shopify Partner
96 14 17

Hi,

 

Checkout 'Additional scripts' will help you do that. Please check this link

banned
Kjankko-US
Shopify Partner
242 4 42

Would help, if I sell i.e products.

 

I collect leads via contact from. After the lead click "Submit" -> it redirects to "Thank you" -page - there should be the event snippet.