Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #469863

    Hi,
    I have already read how to track Events with GA using this script:

    function add_custom_script(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘.ga-buy-1 a’).attr(‘onclick’, ‘ga(\’send\’, \’event\’, \’Buy Button\’, \’Resume\’, \’Resume Template Download\’)\;’);
    jQuery(‘.ga-buy-2 a’).attr(‘onclick’, ‘ga(\’send\’, \’event\’, \’Buy Button\’, \’Resume\’, \’Resume Template Download\’)\;’);
    jQuery(‘.ga-buy-3 a’).attr(‘onclick’, ‘ga(\’send\’, \’event\’, \’Buy Button\’, \’Resume\’, \’Resume Template Download\’)\;’);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_script’);

    My question is how to use other platforms to track events, such as Adwords and Bing Ads. It shouldn’t be too hard, I just don’t know how to use the new script together with the GA script.
    Here is what I need to use:

    <script>
    window.uetq = window.uetq || []; // Create ‘window.uetq’ global tracking object if not already present
    window.uetq.push({ ‘ec’:’Video’, ‘ea’:’Play’, ‘el’:’Product Demo’, ‘ev’:’5′ });
    </script>

    and the inline version:

    <button onclick=”window.uetq = window.uetq || []; window.uetq.push({ ‘ec’:’Video’, ‘ea’:’Play’, ‘el’:’Product Demo’, ‘ev’:’5′ });”>Play</button>

    What I need to do is whenever someone interacts with the element. to send an event to GA and another to Bing Ads, using ‘ga-buy-1’ custom class, for example.

    Thanks guys.

    #470058

    Hi miketica!

    Thank you for using Enfold.

    Maybe you can use the same script. Just replace onclick attriute with the new track script.

    jQuery(‘.ga-buy-1 a’).attr(‘onclick’, ‘window.uetq = window.uetq || []; window.uetq.push({ ‘ec':’Video’, ‘ea':’Play’, ‘el':’Product Demo’, ‘ev':’5′ });’);
    

    Cheers!
    Ismael

    #470387

    Thanks, that’s awesome! I’m trying to figure out how to trigger 2 different events at the same time, one with GA and one with Bing Ads. Do I use 2 different lines:
    jQuery(‘.ga-buy-1 a’).attr(‘onclick’, ‘window.uetq = window.uetq || []; window.uetq.push({ ‘ec’:’Video’, ‘ea’:’Play’, ‘el’:’Product Demo’, ‘ev’:’5′ });’);
    jQuery(‘.ga-buy-1 a’).attr(‘onclick’, ‘ga(\’send\’, \’event\’, \’Buy Button\’, \’Resume\’, \’Resume Template Download\’)\;’);

    or do I use a single line, and, in that case, what is the syntax?

    Thanks again.

    #470649

    Hey!

    Try to put it in a single line:

    jQuery(‘.ga-buy-1 a’).attr(‘onclick’, ‘window.uetq = window.uetq || []; window.uetq.push({ \‘ec\':\’Video\’, \‘ea\':\’Play\’, \‘el\':\’Product Demo\’, \‘ev\':\’5\′ })\; ga(\’send\’, \’event\’, \’Buy Button\’, \’Resume\’, \’Resume Template Download\’)\;’);
    

    Regards,
    Ismael

    #471169

    It doesn’t seem to work, the GA script works by itself, but whenever I add the other part, neither of them works. Hopefully I got the syntax right?

    Thanks.

    #471513

    Hey!

    Send us a link to your page and deactivate all of your plugins and we’ll take a look.

    Regards,
    Elliott

    #476673

    I think I know why it is not working. This is what Bing says:
    Thank your for your response and I hope that you are having a great week.

    “Regarding the query that you sent, I understand that you are having issues in setting up the tracking code on your website. Unlike Adwords, setting an event tracking is done manually and would need 3 tags to be pasted on your source code. You are on the right path that we need add the events in order to complete your goal. Here’s how we can generate the 3 tags needed for the event tracking goal.
    1. Tag from the interface (I believe that you already know about this)
    Ø We will copy the tag on the goal that you created for the account. It’s on the section called Shared Library under the Goals tab. Please make sure that the revenue set is showing as blank.
    2. Java script function to in setting the qualification for each of the event that we have.
    Ø This part of the script will be created in your end to assign a function in setting the event that we require a customer to go through before we consider it as a completed conversion
    Simple example (discount):
    <script>
    function computeDiscount(discount, price) {
    return price – (discount / 100) * price;
    }
    var amount = computeDiscount(20, 100); // Compute the goal value
    </script>
    3. Function to push the information back to our system. This is necessary for us to collect the data that was set up so we can consider the visit as a conversion or not.
    EX:
    <script>
    window.uetq = window.uetq || []; // Pass the computed goal value
    window.uetq.push({ ‘ec’: ‘Download’, ‘ea’:’ Click’, ‘el’:”, ‘ev’:”});
    </script>
    These 3 codes should be integrated on your code in making sure that we set the right qualifications for a complete conversion for an event to take place.

    Thank you for your response and I am happy to give you some insights on how to set up our event tracking with your Bing Ads account. I understand that there are confusion on how we can start on creating the second tag and I do have a few customers before that is having the same trouble. We have two options for you to do this tag:
    1. If your website already have a script to determine which customer downloads the product and which one clicked the intended button that we are trying to filter out, what we need to do is get our developer to integrate the existing javascript and use whatever label they have for “download” and “click”.
    OR
    2. We need to start from scratch and create a function to filter out which of your customers downloads the product and clicked the button. This might be tedious process however with this case the best things is for your developer to do this for us since they best know how the website was set up.
    If there is anything else that we could assist you regarding the same concern, kindly reply so I can get back with you as soon as possible.”

    #476675

    Any help is appreciated. I know this is…a bit complex. So, apparently, that is the issue. If you guys can help, that’s awesome. If not, you’re still awesome for your help so far. Thanks.

    #476877

    Hi!

    Is there any article or documentation about these scripts that we can check? A link to the site where you get the code will help. We need to know what the function means. Did you try using the code block element?

    Cheers!
    Ismael

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.