Created
October 14, 2018 14:44
-
-
Save marcusRB/4fbd25f6c0f349576862be1d19077846 to your computer and use it in GitHub Desktop.
SearchQuery as ViewContent for Google Tag Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SearchQuery as ViewContent for Google Tag Manager - Update 10.2018 MR//PD | |
Trigger: fire tag when search query exist in the URL or searchQuery event fired | |
Remember: Set Tag Sequencing load before main pageView FBads tag | |
*/ | |
<script> | |
fbq('track', 'Search', { | |
search_string: '{{URL - SearchQuery}}', //search term or terms as STRING | |
content_ids: {{cJS - dlv - product.id}}, //show only first 10 elements in ARRAY | |
content_type: 'product', // choose between products or product_group | |
content_category: '{{cJS - dlv - categoryName}}' // category of product, STRING and concat with '>' | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment