Overslaan naar hoofdinhoud

Google Ads tag: Adding your global site tag and specific event snippet to your website - Kennisbank / Zoekmachine Optimalisatie - ShopFactory Help Center

Google Ads tag: Adding your global site tag and specific event snippet to your website

Lijst van auteurs

Setting up your website with the Google Ads tag to set up an audience source for your website

The global site tag is a web tagging library for Google's site measurement, conversion tracking and remarketing products. It’s a block of code that adds your website visitors to remarketing lists, allowing you to target your ads to these visitors.

You can use event snippets which pass specific data to Google Ads about your website visitors.

The global site tag must be added in the <head> section of your website. Whereas the event snippet only needs to be added into the specific pages you want to track for specific events.

1. Install the global site tag in your website. 

If you haven't installed the global site tag on your website, copy the tag from your Google account and paste it in ShopFactory Central > Site Analytics/SEO > Website Analytics > Google Analytics code dialog box. 

Important: Replace the XXXXXXX with your ID (from your own Google Ads/Analytics account).  Enter your correct Google ID here to ensure this works.

Refer to this article - CASE #3 
https://shopfactory.deskpro.com/en/kb/articles/en-adding-custom-html-codes-within-body-head-sections-or-on-the-front-page-of-the-site

2. Setting up event snippets

The event snippet can be used to pass specific data to Google Ads about your website visitors and the actions they take on your site, such as viewing a product, completing purchases. Install the snippet on site pages that you'd like to measure, where the event occurs, for example, when a buyer completes a purchase on your website - this means you need to add the event snippet in the "Thank you" page.

Please ensure you provide users with information about data collection and obtaining consent where legally required.

- Go to http://samplestores.shopfactory.com/gtag-eventsnippet.txt

- Select all and copy the code -> paste in Notepad.

(Or, right-click within the browser content window -> select "Save As..." - if you want to save the text file: gtag-eventsnippet.txt)

Alert: The event snippet should not be copied and pasted 'as-is' for use on your website. It contains placeholder values that must dynamically populate when you integrate the snippet code into your website. 

Note that 'AW-XXXXXXXXXX ' is only an example of an ID. You'll need to replace this part of the 'config' command with your accounts' conversion ID in the global site tag box. 

- Replace the XXXXXXXXXX to your own ID and website primary currency.

3. Add the event snippet to a specific department in ShopFactory

For example, if you want to pass specific data to Google Ads about completed orders with the Order Total and Order Number - then the event snippet needs to be added in the Thank you page.

- At the left-tree menu, select "Thank you" page > click EDIT PAGE > select "Custom Contents" tab

- Click the button to add a new custom html code and then click Edit (pencil) button to go into the custom html dialog

- Open the html dialog and paste your own Google event snippet


***Tick "Field contains Javascript code" checkbox > select Location 1 > click OK

- Save and preview your shop in external browser

- Publish your shop