What's your biggest current challenge? Have your say in Community Polls along the right column.

Google Ads - really struggling with pageview, how can I setup just homepage?

Solved

Google Ads - really struggling with pageview, how can I setup just homepage?

svalkyrie23
Explorer
87 2 7

Hello,

 

On google ads, I installed the tag etc and I can track add to cart, checkout, purchase etc.  But pageview is not working and I don't know why.  I want to have a conversion where someone lands on the homepage.  I've got this listed in the ad settings but it's not triggering. 

How do I setup a conversion just for landing on the homepage?

Accepted Solution (1)

svalkyrie23
Explorer
87 2 7

This is an accepted solution.

To anyone reading this, I figured it out.  If you've been following all the instructions like I have, installed the master tag etc and wondering why you can track checkout, add to cart etc without doing any other changes but PAGE VIEW is not working.... let me clarify.....

SO when you install the tag itself in the shopify apps page with google ads, it installs just the tag and somehow impelmenets that automatically into google ads. So when you go to conversions > troubleshoot against purchase / add to cart / checkout, then it opens the debugger and you navigate to these pages then the debugger says it has found the tag.  So that's fine right?  Google Ads have automatically been able to connect it to shopify.

What is annoying is that PAGE VIEW doesn't come through.  I had seen a few posts on here previously and on google stating that "you need to install the tag manually" and im thinking well if other tags are firing why do I need to do this again.

So what I did:
Went to google ads > Tools > Data Manager > find your google tag and select manage > installation instructions > install manually.
You will see a code snip that you need to go to your theme.liquid file and add it at the top of the <head> section.
WHAT THIS DOES - apparently it tells google ads that "yes there is a tag on this page".
Because when I went to tagassist before and navigated to the home page, it just had a strike through against the page name, like it couldnt find the tag.  I dunno why... I DUNNO why it wasn't covered from the initial shopify installation but it wasn't.  So this code actually says "hey I got a tag here".  BUT not finished yet.  We haven't told it WHAT event to fire.

 


Going back to Google Ads, Conversion > Conversion Goals > Click on Page View and at the bottom go to tag setup, and install yourself.
You will notice a DIFFERENT code snip to before, copy and paste THIS CODE underneath the previous code

So will look something like:

<head>

<!---Google tag (gtag.js) -->
<script async src=......
.... (first code tag)
.....
</script>

<!---Event snippet for Page view conversion page --->

....

(second code snip for event)

<script>
.....

</script>

 

Save it!  Go back to the debugger, and you will see the homepage no longer has a strike through, and on the left you'll see something like "window loaded, dom ready, Page View"  This is the actual event firing now!!  So now the event is verified because it detects the event.

 

I hope more people see this, and actually appreciate the detail to understand WHY this is happening, WHY it wasn't fixed as a result of the initial shopify integration (well we don't know, but now you know its expected) and then WHY you need to add the manual tag as well + the event itself including exact details on where to find them.

I've been tired of searching and searching and people generally just leave random comments that are of no help to other community pages, so I really wanted to break this down best I can for people.

 

PLEASE if you found this helpful like the comment, because at least then I know I will be helping someone and not want anything back for it etc.

 

View solution in original post

Replies 11 (11)

Ihor-Sh
Shopify Partner
79 11 17

You can add custom script in theme.liquid and send custom event in GTAG:

{% if template == 'index' %}
 <script>
 here you need to add push method with DataLayer.push
</script>
{% endif %}

 

Shopify troubleshootibility 😉
If you're satisfied with reply - don't forget to like it.
If you more than satisfied - mark it as solution 😉
You can find me here.
svalkyrie23
Explorer
87 2 7

Im not sure what you mean with the inner part of your code? push method for what, like what code specifically?

If I already have the gtag added to the site as a whole within shopify settings, why do I need to add a specific one onto the homepage for pageview?

Ihor-Sh
Shopify Partner
79 11 17

Hi @svalkyrie23 . You've asked previously: "How do I setup a conversion just for landing on the homepage?". I was answered above how you can push event in gtag for homepage only.

Shopify troubleshootibility 😉
If you're satisfied with reply - don't forget to like it.
If you more than satisfied - mark it as solution 😉
You can find me here.
svalkyrie23
Explorer
87 2 7

im talking about this  " here you need to add push method with DataLayer.push"

Small_Task_Help
Shopify Partner
830 28 75

Hi,

 

Use Google Tag Manager 

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
svalkyrie23
Explorer
87 2 7

Yep. I have this. What I don't have is the shopify advanced plan that includes the ability the customise GTM.....

masoomi-saxena
Shopify Partner
37 0 7

Hi! Here's how you can set up a homepage landing conversion in Google Ads:

Step 1: Create a Conversion Action

First of all, go to your Google ads account and click on 'Conversions' under 'Measurement'.

Then, click '+ Conversion', select 'Website', and name your conversion (e.g., "Homepage Visit").

Step 2: Setup Conversion Settings

For 'Category', choose 'Page view'. Set the 'Value' to "Don't assign a value" and decide if you'll count every or one conversion per click.

Step 3: Test Your Setup

Then, you should test the setup using Google Tag Manager's Preview mode. Why so? To ensure the tag fires correctly on your homepage.

Step 4: Publish Changes

Once you are done verifying that the tag is functioning properly, publish the changes in Google Tag Manager.

If you have further issues, please check if the tag is installed correctly or not. You should also check if your Google Ads account and Tag Manager account are connected properly. 

Plus, do note that it might take 24-48 hours for your conversion data to appear in Google ads. 

Hope this helps! 

Masoomi Saxena | Content Writer @ AdNabu


 - Was my reply helpful? Click Like to let me know! 


 - Was your question answered? Mark it as an Accepted Solution


 - Try our Nabu for Google Shopping Feed App from Shopify App Store. 

svalkyrie23
Explorer
87 2 7

Before doing this, I was already doing Step 3, for page view.  So I would land on homepage and it wouldnt fire the tag.  When I said "already triggered" option on the debugger it didnt do anything. It doesnt work.

 

And as i mentioned previously, I am not on the higher tier shopify plan that allows for GTM customizaiton.  I have GTM, but I don't have the ability to create tags etc, it's not listed on the GTM page.

svalkyrie23
Explorer
87 2 7

@masoomi-saxena So I went into the theme.liquid file, and added the gtag install manual option code in the head of the code.  Now when I use the GTM debugger, instead of having my homepage have a strikethru against it with no events, it now has "Page View" appearing BUT the tag assistant isn't registering it: 

svalkyrie23_0-1723024399017.png


In Tag assistant I also have this error: This Google tag should have been loaded before the gtag('event') command was called. Use an on-page gtag('config') command or a Google tag in Tag Manager to load XX-XXXXXX when the page loads.

 

You can see here it says Page View, this is landing on home page. So why is google not picking it up when it's showing Page View?

svalkyrie23_1-1723024481898.png

Update: I answered my own question here, it is showing Page View for Merchant Center Hit, not Google Ads. So no, page view was not firing for google ads if anyone else sees this and was wondering whats going on here.

svalkyrie23
Explorer
87 2 7

This is an accepted solution.

To anyone reading this, I figured it out.  If you've been following all the instructions like I have, installed the master tag etc and wondering why you can track checkout, add to cart etc without doing any other changes but PAGE VIEW is not working.... let me clarify.....

SO when you install the tag itself in the shopify apps page with google ads, it installs just the tag and somehow impelmenets that automatically into google ads. So when you go to conversions > troubleshoot against purchase / add to cart / checkout, then it opens the debugger and you navigate to these pages then the debugger says it has found the tag.  So that's fine right?  Google Ads have automatically been able to connect it to shopify.

What is annoying is that PAGE VIEW doesn't come through.  I had seen a few posts on here previously and on google stating that "you need to install the tag manually" and im thinking well if other tags are firing why do I need to do this again.

So what I did:
Went to google ads > Tools > Data Manager > find your google tag and select manage > installation instructions > install manually.
You will see a code snip that you need to go to your theme.liquid file and add it at the top of the <head> section.
WHAT THIS DOES - apparently it tells google ads that "yes there is a tag on this page".
Because when I went to tagassist before and navigated to the home page, it just had a strike through against the page name, like it couldnt find the tag.  I dunno why... I DUNNO why it wasn't covered from the initial shopify installation but it wasn't.  So this code actually says "hey I got a tag here".  BUT not finished yet.  We haven't told it WHAT event to fire.

 


Going back to Google Ads, Conversion > Conversion Goals > Click on Page View and at the bottom go to tag setup, and install yourself.
You will notice a DIFFERENT code snip to before, copy and paste THIS CODE underneath the previous code

So will look something like:

<head>

<!---Google tag (gtag.js) -->
<script async src=......
.... (first code tag)
.....
</script>

<!---Event snippet for Page view conversion page --->

....

(second code snip for event)

<script>
.....

</script>

 

Save it!  Go back to the debugger, and you will see the homepage no longer has a strike through, and on the left you'll see something like "window loaded, dom ready, Page View"  This is the actual event firing now!!  So now the event is verified because it detects the event.

 

I hope more people see this, and actually appreciate the detail to understand WHY this is happening, WHY it wasn't fixed as a result of the initial shopify integration (well we don't know, but now you know its expected) and then WHY you need to add the manual tag as well + the event itself including exact details on where to find them.

I've been tired of searching and searching and people generally just leave random comments that are of no help to other community pages, so I really wanted to break this down best I can for people.

 

PLEASE if you found this helpful like the comment, because at least then I know I will be helping someone and not want anything back for it etc.

 

solid_incident
Visitor
1 0 0

I was able to manually add the tag to the theme.liquid file and it was verified as firing. 

 

but when i returned to my Page View conversion tag, the code didn't resemble what you have above. 

Your new code looks like this:

<head>

<!---Google tag (gtag.js) -->
<script async src=......
.... (first code tag)
.....
</script>

<!---Event snippet for Page view conversion page --->

....

(second code snip for event)

<script>
.....

</script>

 

my code looks like this:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-10991958377"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-10991958377');
</script>

 

is it possible for me to copy your code and modify for my account and conversion tag? also curious how you added the Page view conversion tag to just the homepage, or did you add it to theme.liquid.file?

 

I followed these instructions to create a custom HTML section on my homepage to add the Page view tag