Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

v1.9.0

Compare
Choose a tag to compare
@everton-rosario everton-rosario released this 27 Feb 20:56

New feature of transforming and setting content within Instant articles by the Rules.json settings.

Now you are able to add 3 new named properties to your rule set and then these will be added by default into your transformed Instant articles.
Be sure you are using the Transformer::transformString method

  • style_name: Have the default style to be applied to your Instant Article after transformation occurs
  • ads: Has the settings for your ADS, so any new transformed article will have that AD setup
  • analytics: Default structure for setting up the analytics and tracking code for your Instant Articles

There is an easier option for ADS (putting just the Audience Network Placing ID) and one for Analytics, where you can just set it up your FB Pixel id.

Example with AN placement ID and Analytics with FB Pixel:

"style_name" : "mydefaultstyle",
    "ads" : {
        "audience_network_placement_id": "1234",
        "raw_html": "<script>alert('hello world!');</script><div class='block'></div>"
    },
    "analytics" : {
        "fb_pixel_id": "4321",
        "raw_html": "<script>alert('hello world!');</script><div class='block'></div>"
    },
    "rules" :
        [
            ...
        ] 
}