问题
I would line to add the Facebook Conversion Tracking pixel in the Google Tag Management. The only problem I see is that FB is asking to have the code between tags while GTM sits after ... kind of confusing. any ideas ?
回答1:
FB conversion tracking code should be between <body>
and </body>
. Proper deployment of Google Tag Manager is to put container code directly after <body>
. So there is no problem.
回答2:
I was able to configure the Facebook Pixel in Google Tag Manager by doing the following. (this assumes you have your Facebook Pixel code, and a Google Tag Manager account configured.)
Click on "New Tag."
In the "Tag Type" dropdown list, select "Custom HTML Tag." Since there is no preset template for the Facebook conversion pixel, we need to use the Custom HTML Tag template. Name the Tag whatever you would like. For this example, we'll call it "Sales Conversion - Facebook"
Paste your Facebook conversion pixel code into the "HTML" box.
Click on the "+ADD" button for "Firing Rules" to add a new firing rule.
In the "Add Rule(s) modal that opens, select the "Create new rule" radio button, and name your rule. From there, you want to add the condition for which you would like your rule to fire. Once you have created your rule, click "Save" to close the modal.
(Since I am tracking conversion of user sign up, I want this to fire when the confirmation page is reached; so I added {{url}} CONTAINS /user/signup/confirmation.)
Click "Save."
Once returned to the Container page, make sure to publish your changes by clicking the "Publish" button at the top (right side, for me) of the page.
Test to make sure your rule fires when you want. Facebook has created a great chrome extension to help you troubleshoot if the pixel is firing, available here.
To test, install the extension, navigate to a page that doesn't meet your condition and verify that the pixel wasn't loaded, then navigate to a page that does meet your condition and verify that the pixel was loaded.
Cheers!
Complete set up instructions can be found here: http://www.clickz.com/clickz/column/2282137/take-control-of-tagging-with-google-tag-manager-part-1-of-3
来源:https://stackoverflow.com/questions/17752231/can-i-add-facebook-conversion-tracking-in-google-tag-manager